mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
handle arbitrary expressions dependent on static input params in proc signatures
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user