pass-through of static int generic params to arrays when late instantiation is disabled

This commit is contained in:
Zahary Karadjov 2013-08-23 00:42:43 +03:00
commit 8682ed9bd0
8 changed files with 31 additions and 18 deletions

View file

@ -1,17 +1,22 @@
discard """
file: "tstaticparams.nim"
output: "abracadabra\ntest"
output: "abracadabra\ntest\n3"
"""
type
TFoo[T; Val: expr[string]] = object
data: array[4, T]
TBar[T; I: expr[int]] = object
data: array[I, T]
proc takeFoo(x: TFoo) =
echo "abracadabra"
echo TFoo.Val
var x: TFoo[int, "test"]
takeFoo(x)
var y: TBar[float, 4]
echo high(y.data)