Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
`const Foo=int` compiles; is that legal? what does it mean? #8610
It's equivalent to a
import macros const Foo = int macro foo(name: untyped): untyped = newTree(nnkVarSection, newIdentDefs(name, getType(Foo), newLit(5))) foo(bar) echo bar * 3 # 15
I don't think it's documented though it sometimes would be expected to work.
proc test(a = typedesc) = when a is int: echo 123 else: echo "abc"
But still I think it is better to have it consistent.