mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
fixes #1420
This commit is contained in:
@@ -99,7 +99,7 @@ proc isPureObject(typ: PType): bool =
|
||||
|
||||
proc getOrdValue(n: PNode): BiggestInt =
|
||||
case n.kind
|
||||
of nkCharLit..nkInt64Lit: result = n.intVal
|
||||
of nkCharLit..nkUInt64Lit: result = n.intVal
|
||||
of nkNilLit: result = 0
|
||||
of nkHiddenStdConv: result = getOrdValue(n.sons[1])
|
||||
else:
|
||||
|
||||
15
tests/misc/tunsignedcmp.nim
Normal file
15
tests/misc/tunsignedcmp.nim
Normal file
@@ -0,0 +1,15 @@
|
||||
discard """
|
||||
output: '''true
|
||||
true
|
||||
true'''
|
||||
"""
|
||||
|
||||
# bug 1420
|
||||
import unsigned
|
||||
|
||||
var x = 40'u32
|
||||
var y = 30'u32
|
||||
echo x > y # works
|
||||
|
||||
echo((40'i32) > (30'i32))
|
||||
echo((40'u32) > (30'u32)) # Error: ordinal type expected
|
||||
Reference in New Issue
Block a user