guards.nim:sameTree(): handle uint literals correctly (#12483) [backport]
This commit is contained in:
parent
2ccd1c3428
commit
ad3c10022a
2 changed files with 9 additions and 1 deletions
|
|
@ -436,7 +436,7 @@ proc sameTree*(a, b: PNode): bool =
|
||||||
if not result and a.sym.magic != mNone:
|
if not result and a.sym.magic != mNone:
|
||||||
result = a.sym.magic == b.sym.magic or sameOpr(a.sym, b.sym)
|
result = a.sym.magic == b.sym.magic or sameOpr(a.sym, b.sym)
|
||||||
of nkIdent: result = a.ident.id == b.ident.id
|
of nkIdent: result = a.ident.id == b.ident.id
|
||||||
of nkCharLit..nkInt64Lit: result = a.intVal == b.intVal
|
of nkCharLit..nkUInt64Lit: result = a.intVal == b.intVal
|
||||||
of nkFloatLit..nkFloat64Lit: result = a.floatVal == b.floatVal
|
of nkFloatLit..nkFloat64Lit: result = a.floatVal == b.floatVal
|
||||||
of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal
|
of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal
|
||||||
of nkType: result = a.typ == b.typ
|
of nkType: result = a.typ == b.typ
|
||||||
|
|
|
||||||
|
|
@ -582,3 +582,11 @@ template append2*(args: varargs[string, myAppend]): string =
|
||||||
|
|
||||||
let foo = append2("1", "2", "3")
|
let foo = append2("1", "2", "3")
|
||||||
echo foo
|
echo foo
|
||||||
|
|
||||||
|
block t12466:
|
||||||
|
# https://github.com/nim-lang/Nim/issues/12466
|
||||||
|
var a: array[288, uint16]
|
||||||
|
for i in 0'u16 ..< 144'u16:
|
||||||
|
a[0'u16 + i] = i
|
||||||
|
for i in 0'u16 ..< 8'u16:
|
||||||
|
a[0'u16 + i] = i
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue