mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
fixes #23977 The problem is that for *any* body of a generic declaration, [semstmts](2e4d344b43/compiler/semstmts.nim (L1610-L1611)) sets the sym of its value to the generic type name, and [semtypes](2e4d344b43/compiler/semtypes.nim (L2143)) just directly gives the referenced type *specifically* when the expression is a generic body. I'm blaming `semtypes` here because it's responsible for the type given but the exact opposite behavior specifically written in makes me think generating an alias type here maybe breaks something.
9 lines
80 B
Nim
9 lines
80 B
Nim
# issue #23977
|
|
|
|
type Foo[T] = int
|
|
|
|
proc foo(T: typedesc) =
|
|
var a: T
|
|
|
|
foo(int)
|