summary refs log tree commit diff stats
path: root/tests/template/tsymchoicefield.nim
blob: 4483c2aa2af9d8f595e8cf69a09b75d2b3951c90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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