mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
fixes #25000 A failed match on `nfDotField` tries to assert that the name of the dot field is an identifier node. I am not exactly sure how but at some point typed generics causes an `nfDotField` call to contain a symchoice for the field name. The compiler does not use the fact that the field name is an identifier, so the assert is loosened to allow any identifier-like node kind. Could also investigate why the symchoice gets created, my guess is that typed generics detects that the match fails but still sends it through generic prechecking and doesn't remove the `nfDotField`, which is harmless and it might cause more trouble to work around it.
7 lines
179 B
Nim
7 lines
179 B
Nim
# issue #25000
|
|
|
|
proc r(T: typedesc[int]): int = discard
|
|
proc c[J: typedesc[uint]](u = J.r) = discard #[tt.Error
|
|
^ undeclared field: 'r']#
|
|
c[uint]()
|