From 98cec6b6922da62d9fc304de5c1d7cfb28fca879 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Mon, 2 Nov 2020 02:53:00 +0800 Subject: [PATCH] closes #3670 [add testcase for #3670] (#15808) * add testcase * Update tests/template/twhenintemplates.nim Co-authored-by: Clyybber --- tests/template/twhenintemplates.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/template/twhenintemplates.nim diff --git a/tests/template/twhenintemplates.nim b/tests/template/twhenintemplates.nim new file mode 100644 index 0000000000..6fded856de --- /dev/null +++ b/tests/template/twhenintemplates.nim @@ -0,0 +1,11 @@ +# bug #3670 + +template someTempl(someConst: bool) = + when someConst: + var a : int + if true: + when not someConst: + var a : int + a = 5 + +someTempl(true)