fix hintMsgOrigin regression + simplify msgs code (#17805)

This commit is contained in:
Timothee Cour 2021-04-20 22:00:45 -07:00 • committed by GitHub
commit 8de053d870
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 32 deletions

View file

@ -2620,7 +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):
return localErrorNode(c, n, tupexp[i].info, "Mixing types and values in tuples is not allowed.")
return localErrorNode(c, n, "Mixing types and values in tuples is not allowed.", tupexp[i].info)
if isTupleType: # expressions as ``(int, string)`` are reinterpret as type expressions
result = n
var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc})