fix hintMsgOrigin regression + simplify msgs code (#17805)
This commit is contained in:
parent
603af22b7c
commit
8de053d870
6 changed files with 22 additions and 32 deletions
|
|
@ -725,7 +725,7 @@ proc semForVars(c: PContext, n: PNode; flags: TExprFlags): PNode =
|
|||
if n.len == 3:
|
||||
if n[0].kind == nkVarTuple:
|
||||
if n[0].len-1 != iterAfterVarLent.len:
|
||||
return localErrorNode(c, n, n[0].info, errWrongNumberOfVariables)
|
||||
return localErrorNode(c, n, errWrongNumberOfVariables, n[0].info)
|
||||
|
||||
for i in 0..<n[0].len-1:
|
||||
var v = symForVar(c, n[0][i])
|
||||
|
|
@ -1024,8 +1024,7 @@ proc semRaise(c: PContext, n: PNode): PNode =
|
|||
if typ.kind != tyRef:
|
||||
localError(c.config, n.info, errExprCannotBeRaised)
|
||||
if typ.len > 0 and not isException(typ.lastSon):
|
||||
localError(c.config, n.info, "raised object of type $1 does not inherit from Exception",
|
||||
[typeToString(typ)])
|
||||
localError(c.config, n.info, "raised object of type $1 does not inherit from Exception" % typeToString(typ))
|
||||
|
||||
proc addGenericParamListToScope(c: PContext, n: PNode) =
|
||||
if n.kind != nkGenericParams: illFormedAst(n, c.config)
|
||||
|
|
@ -2201,8 +2200,7 @@ proc inferConceptStaticParam(c: PContext, inferred, n: PNode) =
|
|||
if not sameType(res.typ, typ.base):
|
||||
localError(c.config, n.info,
|
||||
"cannot infer the concept parameter '%s', due to a type mismatch. " &
|
||||
"attempt to equate '%s' and '%s'.",
|
||||
[inferred.renderTree, $res.typ, $typ.base])
|
||||
"attempt to equate '%s' and '%s'." % [inferred.renderTree, $res.typ, $typ.base])
|
||||
typ.n = res
|
||||
|
||||
proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue