diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index a6cab96a1f..6302d62b31 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -187,6 +187,18 @@ proc addTempDecl(c: PContext; n: PNode; kind: TSymKind) = styleCheckDef(c, n.info, s, kind) onDef(n.info, s) +proc addTempDeclToIdents(c: PContext; n: PNode; kind: TSymKind; inCall: bool) = + case n.kind + of nkIdent: + if inCall: + addTempDecl(c, n, kind) + of nkCallKinds: + for s in n: + addTempDeclToIdents(c, s, kind, true) + else: + for s in n: + addTempDeclToIdents(c, s, kind, inCall) + proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags, ctx: var GenericCtx): PNode = result = n @@ -359,7 +371,9 @@ proc semGenericStmt(c: PContext, n: PNode, var a = n[i] checkMinSonsLen(a, 1, c.config) for j in 0..