From f0953db3ba59f2e23df2fb7932c672f5020db5fb Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 16 Mar 2014 17:12:30 +0200 Subject: handle arbitrary expressions dependent on static input params in proc signatures --- compiler/semtypinst.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/semtypinst.nim') diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 30810a1d1..4a8a463f5 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -96,8 +96,11 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = checkMetaInvariants(cl, result) proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = + let t = replaceTypeVarsT(cl, n.typ) + if t != nil and t.kind == tyStatic and t.n != nil: + return t.n result = copyNode(n) - result.typ = replaceTypeVarsT(cl, n.typ) + result.typ = t if result.kind == nkSym: result.sym = replaceTypeVarsS(cl, n.sym) let isCall = result.kind in nkCallKinds for i in 0 ..