From c343303efeb063102d33bcb7d214b384f3dcd7df Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Wed, 29 Nov 2017 07:34:30 +0700 Subject: Fix usage of parameters types in templates #6756 (#6768) --- tests/ccgbugs/t6756.nim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/ccgbugs/t6756.nim (limited to 'tests/ccgbugs') diff --git a/tests/ccgbugs/t6756.nim b/tests/ccgbugs/t6756.nim new file mode 100644 index 000000000..0f08557eb --- /dev/null +++ b/tests/ccgbugs/t6756.nim @@ -0,0 +1,18 @@ +import typetraits +type + A[T] = ref object + v: T + +template templ(o: A, op: untyped): untyped = + type T = type(o.v) + + var res: A[T] + + block: + var it {.inject.}: T + it = o.v + res = A[T](v: op) + res + +let a = A[int](v: 1) +echo templ(a, it + 2)[] -- cgit 1.4.1-2-gfad0