Fixes #1986 when calling sameConstant on uint
The problem was saveConstant only checked the range `nkCharLit..nkInt64Lit`, but not up to UInt. This lead to the sonsLen method being called, where sons was never declared. This commit changes it to `nkCharLit..nkUint64Lit`, to match the case statements in the type definition of TNode, in ast.nim.
This commit is contained in:
parent
b48f9c4e14
commit
0fa82763fe
1 changed files with 1 additions and 1 deletions
|
|
@ -368,7 +368,7 @@ proc sameConstant*(a, b: PNode): bool =
|
||||||
case a.kind
|
case a.kind
|
||||||
of nkSym: result = a.sym == b.sym
|
of nkSym: result = 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, nkNilLit: result = a.typ == b.typ
|
of nkType, nkNilLit: result = a.typ == b.typ
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue