From 26f183043f9e58eb4954d50a5d130d8684909936 Mon Sep 17 00:00:00 2001 From: Bung Date: Fri, 4 Aug 2023 19:35:43 +0800 Subject: fix #20883 Unspecified generic on default value segfaults the compiler (#21172) * fix #20883 Unspecified generic on default value segfaults the compiler * fallback to isGeneric * change to closer error * Update t20883.nim --- tests/misc/t20883.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/misc/t20883.nim (limited to 'tests/misc') diff --git a/tests/misc/t20883.nim b/tests/misc/t20883.nim new file mode 100644 index 000000000..d98feaa14 --- /dev/null +++ b/tests/misc/t20883.nim @@ -0,0 +1,12 @@ +discard """ + action: reject + errormsg: "type mismatch: got but expected 'typeof(U(0.000001))'" + line: 8 + column: 22 +""" + +proc foo*[U](x: U = U(1e-6)) = + echo x + +foo[float]() +foo() -- cgit 1.4.1-2-gfad0