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
macrofoo(x: typed) =result= x
echoresult.repr
block: # or `proc main =`
foo:
typeFoo=objectechoFoo()
Nim Version
2.0.0
Current Output
type
Foo_520093702 = object
(7, 8) Error: undeclared identifier: 'Foo'
Expected Output
type
Foo = object
()
Possible Solution
Read comments below (#22571 (comment) and #22571 (comment)) for description of why this happens. The issue is caused by the compiler intentionally gensymming these types to workaround a codegen issue that should have been solved in codegen.
Additional Information
Works if the macro is called at top level, or with declarations that are not types like proc or const