diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 05bfae0df8..a5049fc321 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -482,6 +482,7 @@ proc semResolvedCall(c: PContext, x: TCandidate, result.sons[0] = newSymNode(finalCallee, getCallLineInfo(result.sons[0])) if containsGenericType(result.typ) or x.fauxMatch == tyUnknown: result.typ = newTypeS(x.fauxMatch, c) + if result.typ.kind == tyError: incl result.typ.flags, tfCheckedForDestructor return let gp = finalCallee.ast.sons[genericParamsPos] if gp.kind != nkEmpty: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index f215d4a45d..6e1a666c1b 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -50,6 +50,7 @@ proc newOrPrevType(kind: TTypeKind, prev: PType, c: PContext): PType = else: result = prev if result.kind == tyForward: result.kind = kind + #if kind == tyError: result.flags.incl tfCheckedForDestructor proc newConstraint(c: PContext, k: TTypeKind): PType = result = newTypeS(tyBuiltInTypeClass, c)