From d5fffc032f2b390abd7b4c4fea2e49b1a0ef9736 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 26 May 2013 16:23:23 +0300 Subject: [PATCH] fix threading tests * more type names are valid expressions now * void is properly stripped off during generic instantiation --- compiler/semexprs.nim | 2 +- compiler/seminst.nim | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index e07821d1f5..daad93a857 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1769,7 +1769,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkBind: Message(n.info, warnDeprecated, "bind") result = semExpr(c, n.sons[0], flags) - of nkTypeOfExpr: + of nkTypeOfExpr, nkTupleTy, nkRefTy..nkEnumTy: var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc}) result = symNodeFromType(c, typ, n.info) of nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit: diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 431635b9c5..98f25efa7c 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -165,28 +165,35 @@ proc fixupProcTypeR(c: PContext, genericType: PType, of tyOpenArray, tyArray, tySet, tySequence, tyTuple, tyProc, tyPtr, tyVar, tyRef, tyOrdinal, tyRange, tyVarargs: if genericType.sons == nil: return + var head = 0 for i in 0 ..