diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 44f3969962..70cb64b516 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -64,7 +64,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, template maybeDotChoice(c: PContext, n: PNode, s: PSym, fromDotExpr: bool) = if fromDotExpr: result = symChoice(c, n, s, scForceOpen) - if result.len == 1: + if result.kind == nkOpenSymChoice and result.len == 1: result.transitionSonsKind(nkClosedSymChoice) else: result = symChoice(c, n, s, scOpen) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 84622f0ad4..9edb2d0ca5 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -70,6 +70,9 @@ proc symChoice(c: PContext, n: PNode, s: PSym, r: TSymChoiceRule; onUse(info, s) else: result = n + elif i == 0: + # forced open but symbol not in scope, retain information + result = n else: # semantic checking requires a type; ``fitNode`` deals with it # appropriately @@ -110,14 +113,10 @@ proc semBindStmt(c: PContext, n: PNode, toBind: var IntSet): PNode = proc semMixinStmt(c: PContext, n: PNode, toMixin: var IntSet): PNode = result = copyNode(n) - var count = 0 for i in 0..