diff options
author | Zahary Karadjov <zahary@gmail.com> | 2014-12-31 03:50:43 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2014-12-31 04:18:35 +0200 |
commit | b83b1383fb7dc423a812b9a6de64b9155f36d407 (patch) | |
tree | 8d1b2f35da29d2e9593cb4da6a3c6b4b4177b651 /compiler | |
parent | 1b54c55b7b41f638b47a1222036ece208b99cbd3 (diff) | |
download | Nim-b83b1383fb7dc423a812b9a6de64b9155f36d407.tar.gz |
fix #1056
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semexprs.nim | 4 | ||||
-rw-r--r-- | compiler/semgnrc.nim | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index b2f623fb8..60240e6eb 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -926,7 +926,8 @@ const proc readTypeParameter(c: PContext, typ: PType, paramName: PIdent, info: TLineInfo): PNode = let ty = if typ.kind == tyGenericInst: typ.skipGenericAlias - else: (internalAssert(typ.kind == tyCompositeTypeClass); typ.sons[1]) + else: (internalAssert(typ.kind == tyCompositeTypeClass); + typ.sons[1].skipGenericAlias) #debug ty let tbody = ty.sons[0] for s in countup(0, tbody.len-2): @@ -965,6 +966,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = var ty = n.sons[0].typ var f: PSym = nil result = nil + if isTypeExpr(n.sons[0]) or (ty.kind == tyTypeDesc and ty.base.kind != tyNone): if ty.kind == tyTypeDesc: ty = ty.base ty = ty.skipTypes(tyDotOpTransparent) diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 06959b8d1..1ab4f5989 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -72,7 +72,8 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, result = n styleCheckUse(n.info, s) of skType: - if (s.typ != nil) and (s.typ.kind != tyGenericParam): + if (s.typ != nil) and + (s.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} == {}): result = newSymNodeTypeDesc(s, n.info) else: result = n |