From 3df652b90b9d5ccf7370ffb27eb5ee9f3c8a6cd2 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Fri, 22 Jan 2021 02:11:21 +0100 Subject: [PATCH] Add testcase for #5993 (#16789) --- tests/template/template_issues.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/template/template_issues.nim b/tests/template/template_issues.nim index d12b3c3ef4..b4b056da5f 100644 --- a/tests/template/template_issues.nim +++ b/tests/template/template_issues.nim @@ -274,3 +274,19 @@ ggg(hello) var z = 10'u8 echo z < 9 # Works echo z > 9 # Error: type mismatch + + +# bug #5993 +template foo(p: proc) = + var bla = 5 + p(bla) + +foo() do(t: var int): + discard + t = 5 + +proc bar(t: var int) = + t = 5 + +foo(bar) +