static params: expr[T] is now static[T]

This introduces tyStatic and successfully bootstraps and handles
few simple test cases.  Static params within macros are no longer
treated as PNimrodNodes - they are now equivalent to constants
of the designated type.
This commit is contained in:
Zahary Karadjov 2013-12-19 01:06:38 +02:00
commit 027f30610e
22 changed files with 135 additions and 110 deletions

View file

@ -4,15 +4,15 @@ discard """
"""
type
TFoo[T; Val: expr[string]] = object
TFoo[T; Val: static[string]] = object
data: array[4, T]
TBar[T; I: expr[int]] = object
TBar[T; I: static[int]] = object
data: array[I, T]
TA1[T; I: expr[int]] = array[I, T]
TA2[T; I: expr[int]] = array[0..I, T]
TA3[T; I: expr[int]] = array[I-1, T]
#TA1[T; I: static[int]] = array[I, T]
#TA2[T; I: static[int]] = array[0..I, T]
TA3[T; I: static[int]] = array[I-1, T]
proc takeFoo(x: TFoo) =
echo "abracadabra"