Introduce localErrorNode (#17785)
This commit is contained in:
parent
6de5aa1971
commit
438afb4db9
7 changed files with 27 additions and 24 deletions
|
|
@ -1044,8 +1044,7 @@ proc buildEchoStmt(c: PContext, n: PNode): PNode =
|
|||
if e != nil:
|
||||
result.add(newSymNode(e))
|
||||
else:
|
||||
localError(c.config, n.info, "system needs: echo")
|
||||
result.add(errorNode(c, n))
|
||||
result.add localErrorNode(c, n, "system needs: echo")
|
||||
result.add(n)
|
||||
result = semExpr(c, result)
|
||||
|
||||
|
|
@ -2621,8 +2620,7 @@ proc semTupleConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
|||
# check if either everything or nothing is tyTypeDesc
|
||||
for i in 1..<tupexp.len:
|
||||
if isTupleType != (tupexp[i].typ.kind == tyTypeDesc):
|
||||
localError(c.config, tupexp[i].info, "Mixing types and values in tuples is not allowed.")
|
||||
return(errorNode(c,n))
|
||||
return localErrorNode(c, n, tupexp[i].info, "Mixing types and values in tuples is not allowed.")
|
||||
if isTupleType: # expressions as ``(int, string)`` are reinterpret as type expressions
|
||||
result = n
|
||||
var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue