guards.nim:sameTree(): handle uint literals correctly (#12483) [backport]

This commit is contained in:
Paul Tan 2019-10-23 00:18:33 +08:00 • committed by Andreas Rumpf
commit ad3c10022a
2 changed files with 9 additions and 1 deletions

View file

@ -436,7 +436,7 @@ proc sameTree*(a, b: PNode): bool =
if not result and a.sym.magic != mNone:
result = a.sym.magic == b.sym.magic or sameOpr(a.sym, b.sym)
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 nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal
of nkType: result = a.typ == b.typ