Files
Nim/tests/template/tsymchoicefield.nim
2017-07-25 09:28:23 +02:00

12 lines
253 B
Nim

type Foo = object
len: int
var f = Foo(len: 40)
template getLen(f: Foo): int = f.len
echo f.getLen
# This fails, because `len` gets the nkOpenSymChoice
# treatment inside the template early pass and then
# it can't be recognized as a field anymore