You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiles normally on 'play.nim-lang.org' without uncommenting.
Compiling locally will report an error, just like the title says.
import std/tables
# After uncommenting and compiling on 'play.nim-lang.org', an error will be reported (killed by system)# import std/asyncnet# import std/asyncdispatchtype
A =proc ()
procmain=let repo =initTable[uint32, A]()
let c1 = repo.getOrDefault(uint32(1), nil)
echo"c1.isNil: ", c1.isNil
let c2 = repo.getOrDefault(uint32(1), A(nil))
echo"c2.isNil: ", c2.isNil
main()
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-05-05
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 1ef4d04
active boot switches: -d:release
Current Output
/root/repos/spaces2/a.nim(13, 16) template/generic instantiation of `getOrDefault` from here
/root/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(437, 19) Error: type mismatch: got <typedesc[A]>
but expected one of:
A = proc (){.closure.}
Expected Output
no error
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
haoyu234
changed the title
Error: type mismatch: got <typedesc[A]>, but expected one of: A = proc (b: B){.closure.}
Error: type mismatch: got <typedesc[A]>, but expected one of: A = proc (){.closure.}
May 9, 2024
Description
https://play.nim-lang.org/#pasty=cVWRkhXTOfpv
Compiles normally on 'play.nim-lang.org' without uncommenting.
Compiling locally will report an error, just like the title says.
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-05-05
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 1ef4d04
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: