From 98f71e19779623e0d6c3be37ea9797fe952f80fe Mon Sep 17 00:00:00 2001 From: metagn <10591326+metagn@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:37:08 +0300 Subject: [PATCH] should fix CI --- compiler/semexprs.nim | 5 ++++- compiler/semgnrc.nim | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index d6d9c1adf7a3..5e75a23d1953 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1024,7 +1024,10 @@ proc afterCallActions(c: PContext; n, orig: PNode, flags: TExprFlags; expectedTy of skMacro: result = semMacroExpr(c, result, orig, callee, flags, expectedType) of skTemplate: result = semTemplateExpr(c, result, callee, flags, expectedType) else: - semFinishOperands(c, result) + if callee.magic notin {mArrGet, mArrPut, mNBindSym}: + # calls to `[]` can be explicit generic instantiations, + # don't sem every operand now, leave it to semmagic + semFinishOperands(c, result) activate(c, result) fixAbstractType(c, result) analyseIfAddressTakenInCall(c, result) diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 3236ee0855ed..5a20bbd5e000 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -69,7 +69,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, result.transitionSonsKind(nkClosedSymChoice) else: result = symChoice(c, n, s, scOpen) - if withinMixin in flags and result.kind == nkSym: + if {withinMixin, withinConcept} * flags == {withinMixin} and result.kind == nkSym: result.flags.incl nfOpenSym result.typ = nil case s.kind @@ -99,7 +99,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, result = n else: result = newSymNodeTypeDesc(s, c.idgen, n.info) - if withinMixin in flags: + if {withinMixin, withinConcept} * flags == {withinMixin}: result.flags.incl nfOpenSym result.typ = nil onUse(n.info, s) @@ -110,7 +110,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, if (s.typ != nil) and (s.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} == {}): result = newSymNodeTypeDesc(s, c.idgen, n.info) - if withinMixin in flags: + if {withinMixin, withinConcept} * flags == {withinMixin}: result.flags.incl nfOpenSym result.typ = nil else: @@ -118,7 +118,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, onUse(n.info, s) else: result = newSymNode(s, n.info) - if withinMixin in flags: + if {withinMixin, withinConcept} * flags == {withinMixin}: result.flags.incl nfOpenSym result.typ = nil onUse(n.info, s) @@ -245,7 +245,7 @@ proc semGenericStmt(c: PContext, n: PNode, if s2 != nil and s2 != a and not c.isAmbiguous and s2.owner == c.p.owner: n.sym = s2 a = s2 - if withinMixin notin flags: + if {withinMixin, withinConcept} * flags != {withinMixin}: n.flags.excl nfOpenSym let b = getGenSym(c, a) if b != a: n.sym = b