diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 50d7860f3574a..f8b81a958b1d4 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1105,7 +1105,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags; expectedType: PType let t = n[0].typ if t != nil and t.kind in {tyVar, tyLent}: n[0] = newDeref(n[0]) - elif isSymChoice(n[0]) and nfDotField notin n.flags: + elif (isSymChoice(n[0]) or (n[0].kind == nkSym and isGenericRoutineStrict(n[0].sym))) and nfDotField notin n.flags: # overloaded generic procs e.g. newSeq[int] can end up here return semDirectOp(c, n, flags, expectedType) diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 02ec23fc3e271..71941bb5ed918 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -1077,6 +1077,19 @@ proc trackCall(tracked: PEffects; n: PNode) = if n.typ != nil: if tracked.owner.kind != skMacro and n.typ.skipTypes(abstractVar).kind != tyOpenArray: createTypeBoundOps(tracked, n.typ, n.info) + if tracked.c.matchedConcept == nil and a.kind == nkSym: + if a.sym.isGenericRoutineStrict() and a.sym.magic notin {mSizeOf, mZeroDefault, mTypeOf}: + # this error is likely a compiler bug + + # it is not instantiated if there is an error + var hasErrorType = false + for i in 1..