handle arbitrary expressions dependent on static input params in proc signatures

This commit is contained in:
Zahary Karadjov
2014-03-16 17:12:30 +02:00
parent da5d88f04e
commit f0953db3ba
10 changed files with 60 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
discard """
line: 1855
line: 1912
file: "system.nim"
errormsg: "can raise an unlisted exception: ref EIO"
"""

View File

@@ -0,0 +1,16 @@
discard """
msg: "array[0..3, int]"
"""
type
KK[I: static[int]] = object
x: array[I, int]
proc foo(a: static[string]): KK[a.len] =
result.x[0] = 12
var x = foo "test"
import typetraits
static: echo x.x.type.name

View File

@@ -1,5 +1,5 @@
discard """
msg: 'type mismatch: got (PTest)'
msg: "type mismatch: got (PTest)"
"""
type