diff --git a/compiler/ast/ast.nim b/compiler/ast/ast.nim index 3665b29341d..f0ad4625253 100644 --- a/compiler/ast/ast.nim +++ b/compiler/ast/ast.nim @@ -193,32 +193,6 @@ proc newIdentNode*(ident: PIdent, info: TLineInfo): PNode = result.ident = ident result.info = info -proc newSymNode2*(sym: PSym): PNode = - ## creates a new `nkSym` node, unless sym.kind is an skError where an nkError - ## is extracted from the sym and returned instead. - ## NB: not a `newSymNode` replacement, it's for when symbol sem fails - if sym.isError: - result = sym.ast - else: - result = newNode(nkSym) - result.sym = sym - result.typ = sym.typ - result.info = sym.info - -proc newSymNode2*(sym: PSym, info: TLineInfo): PNode = - ## creates a new `nkSym` node, unless sym.kind is an skError where an nkError - ## is extracted from the sym and returned instead. In either case sets the - ## node info to the one provided - ## NB: not a `newSymNode` replacement, it's for when symbol sem fails - if sym.isError: - result = sym.ast - result.info = info - else: - result = newNode(nkSym) - result.sym = sym - result.typ = sym.typ - result.info = info - proc newSymNodeIT*(sym: PSym, info: TLineInfo, typ: PType): PNode = ## create a new sym node with the supplied `info` and `typ` result = newNodeIT(nkSym, info, typ) diff --git a/compiler/ast/ast_types.nim b/compiler/ast/ast_types.nim index 4bba6e9b78a..83d76336cb3 100644 --- a/compiler/ast/ast_types.nim +++ b/compiler/ast/ast_types.nim @@ -1070,6 +1070,7 @@ type AstDiagKind* = enum # general adWrappedError + adWrappedSymError adCyclicTree # type adSemTypeMismatch @@ -1279,7 +1280,7 @@ type location*: TLineInfo # TODO: `wrongNode` already has this, move to # variant or handle in display/rendering case kind*: AstDiagKind - of adWrappedError: + of adWrappedError, adWrappedSymError: discard of adSemTypeMismatch, adSemIllegalConversion, diff --git a/compiler/ast/errorhandling.nim b/compiler/ast/errorhandling.nim index eb34e2e75a2..e54e38ab409 100644 --- a/compiler/ast/errorhandling.nim +++ b/compiler/ast/errorhandling.nim @@ -189,7 +189,7 @@ iterator walkErrors*(config: ConfigRef; n: PNode): PNode = for i in 0..