From e8c50640d7a4d386197b8508c82b26f5563060cb Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 24 Mar 2014 12:17:22 +0200 Subject: failing test case preventing the use of --gc:v2: tsymchoicefield --- tests/template/tsymchoicefield.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/template/tsymchoicefield.nim (limited to 'tests/template') diff --git a/tests/template/tsymchoicefield.nim b/tests/template/tsymchoicefield.nim new file mode 100644 index 000000000..ab05500bf --- /dev/null +++ b/tests/template/tsymchoicefield.nim @@ -0,0 +1,12 @@ +type Foo = object + len: int + +var f = Foo(len: 40) + +template getLen(f: Foo): expr = 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 + -- cgit 1.4.1-2-gfad0