Revert localErrorNode param order changes (#17809)

* Revert localErrorNode param order changes

* Remove unused globalError overload

* heh
This commit is contained in:
Clyybber 2021-04-21 16:03:30 +02:00 • committed by GitHub
commit 80389b8053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 13 deletions

View file

@ -501,13 +501,23 @@ proc errorNode*(c: PContext, n: PNode): PNode =
result = newNodeI(nkEmpty, n.info)
result.typ = errorType(c)
template localErrorNode*(c: PContext, n: PNode, arg: string, info: TLineInfo, kind: TMsgKind = errGenerated): PNode =
liMessage(c.config, info, kind, arg, doNothing, instLoc())
# These mimic localError
template localErrorNode*(c: PContext, n: PNode, info: TLineInfo, msg: TMsgKind, arg: string): PNode =
liMessage(c.config, info, msg, arg, doNothing, instLoc())
errorNode(c, n)
template localErrorNode*(c: PContext, n: PNode, arg: string, kind: TMsgKind = errGenerated): PNode =
template localErrorNode*(c: PContext, n: PNode, info: TLineInfo, arg: string): PNode =
liMessage(c.config, info, errGenerated, arg, doNothing, instLoc())
errorNode(c, n)
template localErrorNode*(c: PContext, n: PNode, msg: TMsgKind, arg: string): PNode =
let n2 = n
liMessage(c.config, n2.info, kind, arg, doNothing, instLoc())
liMessage(c.config, n2.info, msg, arg, doNothing, instLoc())
errorNode(c, n2)
template localErrorNode*(c: PContext, n: PNode, arg: string): PNode =
let n2 = n
liMessage(c.config, n2.info, errGenerated, arg, doNothing, instLoc())
errorNode(c, n2)
proc fillTypeS*(dest: PType, kind: TTypeKind, c: PContext) =