mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
15 lines
256 B
Nim
15 lines
256 B
Nim
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
|
|
|