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
Error: type mismatch: got <untyped>
but expected one of:
proc foo(x: proc ())
first type mismatch at position: 1
required type for x: proc (){.closure.}
but expression 'nil' is of type: untyped
expression: foo(nil)
Expected Output
compiles
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
…4165)
fixes#24164, regression from #20091
The expression `nil` as the default value of template parameter `x:
untyped` is typechecked with expected type `untyped` since #20091. The
expected type is checked if it matches the `nil` literal with a match
better than a subtype match, and the type is set to it if it does.
However `untyped` matches with a generic match which is better, so the
`nil` literal has type `untyped`. This breaks type matching for the
literal. So if the expected type is `untyped` or `typed`, it is now
ignored and the `nil` literal just has the `nil` type.
(cherry picked from commit b9de2bb)
Description
Nim Version
6f6e34e, 2.0
Current Output
Expected Output
Known Workarounds
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: