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:
parent
7120491d05
commit
027f30610e
22 changed files with 135 additions and 110 deletions
|
|
@ -192,6 +192,7 @@ type
|
|||
nkObjectTy, # object body
|
||||
nkTupleTy, # tuple body
|
||||
nkTypeClassTy, # user-defined type class
|
||||
nkStaticTy, # ``static[T]``
|
||||
nkRecList, # list of object parts
|
||||
nkRecCase, # case section of object
|
||||
nkRecWhen, # when section of object
|
||||
|
|
@ -336,12 +337,13 @@ type
|
|||
tyIter, # unused
|
||||
tyProxy # used as errornous type (for idetools)
|
||||
tyTypeClass
|
||||
tyParametricTypeClass # structured similarly to tyGenericInst
|
||||
# lastSon is the body of the type class
|
||||
tyAnd
|
||||
tyOr
|
||||
tyNot
|
||||
tyAnything
|
||||
tyParametricTypeClass # structured similarly to tyGenericInst
|
||||
# lastSon is the body of the type class
|
||||
tyStatic
|
||||
|
||||
const
|
||||
tyPureObject* = tyTuple
|
||||
|
|
@ -1232,7 +1234,7 @@ proc propagateToOwner*(owner, elem: PType) =
|
|||
if tfShared in elem.flags:
|
||||
owner.flags.incl tfHasShared
|
||||
|
||||
if elem.kind in {tyExpr, tyTypeDesc}:
|
||||
if elem.kind in {tyExpr, tyStatic, tyTypeDesc}:
|
||||
owner.flags.incl tfHasMeta
|
||||
elif elem.kind in {tyString, tyRef, tySequence} or
|
||||
elem.kind == tyProc and elem.callConv == ccClosure:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue