mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 04:44:20 +00:00
@@ -1822,7 +1822,7 @@ proc genNewSeq(p: PProc, n: PNode) =
|
||||
x.rdLoc, y.rdLoc, createVar(p, t, false)])
|
||||
|
||||
proc genOrd(p: PProc, n: PNode, r: var TCompRes) =
|
||||
case skipTypes(n[1].typ, abstractVar).kind
|
||||
case skipTypes(n[1].typ, abstractVar + abstractRange).kind
|
||||
of tyEnum, tyInt..tyUInt64, tyChar: gen(p, n[1], r)
|
||||
of tyBool: unaryExpr(p, n, r, "", "($1 ? 1:0)")
|
||||
else: internalError(p.config, n.info, "genOrd")
|
||||
|
||||
11
tests/js/t14570.nim
Normal file
11
tests/js/t14570.nim
Normal file
@@ -0,0 +1,11 @@
|
||||
discard """
|
||||
output: '''
|
||||
18
|
||||
'''
|
||||
"""
|
||||
|
||||
type A = range[15 .. 30]
|
||||
|
||||
let a: A = 18
|
||||
|
||||
echo ord(a)
|
||||
Reference in New Issue
Block a user