mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-10 06:54:16 +00:00
Merge pull request #2499 from JosephTurner/fix-uint-segv
Fixes #1986 when calling sameConstant on uint
This commit is contained in:
@@ -368,7 +368,7 @@ proc sameConstant*(a, b: PNode): bool =
|
||||
case a.kind
|
||||
of nkSym: result = 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, nkNilLit: result = a.typ == b.typ
|
||||
|
||||
10
tests/tuples/tuint_tuple.nim
Normal file
10
tests/tuples/tuint_tuple.nim
Normal file
@@ -0,0 +1,10 @@
|
||||
# bug #1986 found by gdmoore
|
||||
|
||||
proc test(): int64 =
|
||||
return 0xdeadbeef.int64
|
||||
|
||||
const items = [
|
||||
(var1: test(), var2: 100'u32),
|
||||
(var1: test(), var2: 192'u32)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user