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
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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue