diff options
author | Zahary Karadjov <zahary@gmail.com> | 2014-03-15 19:32:49 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2014-03-16 20:42:06 +0200 |
commit | 27c2c1e75ce9f7bf21dcbbb4625f494a6ac5837e (patch) | |
tree | 603d4c30333cb7e00cefdbc5d3e957c9cf81db3d /compiler | |
parent | 37b199d34ae198872f061d9a4155539138b34c87 (diff) | |
download | Nim-27c2c1e75ce9f7bf21dcbbb4625f494a6ac5837e.tar.gz |
fix #996
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ast.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 55de43dd1..a48ba9dc5 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -398,7 +398,7 @@ const tyUserTypeClass, tyUserTypeClassInst, tyAnd, tyOr, tyNot, tyAnything} - tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyStatic, tyExpr} + tyTypeClasses + tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyExpr} + tyTypeClasses type TTypeKinds* = set[TTypeKind] @@ -969,7 +969,9 @@ var emptyNode* = newNode(nkEmpty) # There is a single empty node that is shared! Do not overwrite it! proc isMetaType*(t: PType): bool = - return t.kind in tyMetaTypes or tfHasMeta in t.flags + return t.kind in tyMetaTypes or + (t.kind == tyStatic and t.n == nil) or + tfHasMeta in t.flags proc linkTo*(t: PType, s: PSym): PType {.discardable.} = t.sym = s @@ -1313,7 +1315,7 @@ proc propagateToOwner*(owner, elem: PType) = if tfShared in elem.flags: owner.flags.incl tfHasShared - if elem.kind in tyMetaTypes: + if elem.isMetaType: owner.flags.incl tfHasMeta if elem.kind in {tyString, tyRef, tySequence} or |