parent
51bd442b88
commit
5f6997794e
2 changed files with 6 additions and 1 deletions
|
|
@ -522,7 +522,7 @@ proc changeType(c: PContext; n: PNode, newType: PType, check: bool) =
|
||||||
a.add m
|
a.add m
|
||||||
changeType(m, tup[i], check)
|
changeType(m, tup[i], check)
|
||||||
of nkCharLit..nkUInt64Lit:
|
of nkCharLit..nkUInt64Lit:
|
||||||
if check and n.kind != nkUInt64Lit:
|
if check and n.kind != nkUInt64Lit and not sameType(n.typ, newType):
|
||||||
let value = n.intVal
|
let value = n.intVal
|
||||||
if value < firstOrd(c.config, newType) or value > lastOrd(c.config, newType):
|
if value < firstOrd(c.config, newType) or value > lastOrd(c.config, newType):
|
||||||
localError(c.config, n.info, "cannot convert " & $value &
|
localError(c.config, n.info, "cannot convert " & $value &
|
||||||
|
|
|
||||||
|
|
@ -55,3 +55,8 @@ const x0 = fun()
|
||||||
echo typeof(x0)
|
echo typeof(x0)
|
||||||
|
|
||||||
discard $x0
|
discard $x0
|
||||||
|
|
||||||
|
# bug #13671
|
||||||
|
|
||||||
|
const x1 = cast[uint](-1)
|
||||||
|
discard $(x1,)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue