mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
* fix #20883 Unspecified generic on default value segfaults the compiler
* fallback to isGeneric
* change to closer error
* Update t20883.nim
(cherry picked from commit 26f183043f)
13 lines
195 B
Nim
13 lines
195 B
Nim
discard """
|
|
action: reject
|
|
errormsg: "type mismatch: got <float64> but expected 'typeof(U(0.000001))'"
|
|
line: 8
|
|
column: 22
|
|
"""
|
|
|
|
proc foo*[U](x: U = U(1e-6)) =
|
|
echo x
|
|
|
|
foo[float]()
|
|
foo()
|