handle arbitrary expressions dependent on static input params in proc signatures
This commit is contained in:
parent
da5d88f04e
commit
f0953db3ba
10 changed files with 60 additions and 18 deletions
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
line: 1855
|
||||
line: 1912
|
||||
file: "system.nim"
|
||||
errormsg: "can raise an unlisted exception: ref EIO"
|
||||
"""
|
||||
|
|
|
|||
16
tests/generics/tlateboundstatic.nim
Normal file
16
tests/generics/tlateboundstatic.nim
Normal 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
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
msg: 'type mismatch: got (PTest)'
|
||||
msg: "type mismatch: got (PTest)"
|
||||
"""
|
||||
|
||||
type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue