From 062e77bce0ab46990608e3fe3c05efcf7d24da5f Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:39:55 +0800 Subject: [PATCH] adds a test case (#24486) closes #23680 (cherry picked from commit ddf5a9f6c5cf2d16958edf774d545343bc07cadf) --- tests/template/template_issues.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/template/template_issues.nim b/tests/template/template_issues.nim index 58c40941db..f44de789eb 100644 --- a/tests/template/template_issues.nim +++ b/tests/template/template_issues.nim @@ -13,6 +13,7 @@ foo foo false true +0 ''' """ @@ -302,3 +303,10 @@ block: # bug #21920 discard t[void]() # Error: expression has no type: discard + +template m(a: uint, p: int) = discard + +block: # bug #23680 + template m(x: untyped, i: int) = echo x + proc j(n: int | int) = m([0][0], 0) + j(0)