fix #5864
This commit is contained in:
parent
dea6d8dd94
commit
f713e730c8
2 changed files with 16 additions and 0 deletions
14
tests/generics/tgenericsdefaultvalues.nim
Normal file
14
tests/generics/tgenericsdefaultvalues.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
discard """
|
||||
output: "12"
|
||||
"""
|
||||
|
||||
# https://github.com/nim-lang/Nim/issues/5864
|
||||
|
||||
proc defaultStatic(s: openarray, N: static[int] = 1): int = N
|
||||
proc defaultGeneric[T](a: T = 2): int = a
|
||||
|
||||
let a = [1, 2, 3, 4].defaultStatic()
|
||||
let b = defaultGeneric()
|
||||
|
||||
echo a, b
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue