mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
manual merge 2
This commit is contained in:
@@ -649,7 +649,7 @@ proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} =
|
||||
isNone
|
||||
|
||||
if f.isOrdinalType:
|
||||
checkRange(firstOrd(a), lastOrd(a), firstOrd(f), lastOrd(f))
|
||||
checkRange(firstOrd(nil, a), lastOrd(nil, a), firstOrd(nil, f), lastOrd(nil, f))
|
||||
else:
|
||||
checkRange(firstFloat(a), lastFloat(a), firstFloat(f), lastFloat(f))
|
||||
|
||||
|
||||
@@ -643,7 +643,7 @@ proc firstFloat*(t: PType): BiggestFloat =
|
||||
internalError(newPartialConfigRef(), "invalid kind for firstFloat(" & $t.kind & ')')
|
||||
NaN
|
||||
|
||||
proc lastOrd*(t: PType; fixedUnsigned = false): BiggestInt =
|
||||
proc lastOrd*(conf: ConfigRef; t: PType; fixedUnsigned = false): BiggestInt =
|
||||
case t.kind
|
||||
of tyBool: result = 1
|
||||
of tyChar: result = 255
|
||||
@@ -699,7 +699,7 @@ proc lastFloat*(t: PType): BiggestFloat =
|
||||
NaN
|
||||
|
||||
|
||||
proc lengthOrd*(t: PType): BiggestInt =
|
||||
proc lengthOrd*(conf: ConfigRef; t: PType): BiggestInt =
|
||||
case t.kind
|
||||
of tyInt64, tyInt32, tyInt: result = lastOrd(conf, t)
|
||||
of tyDistinct: result = lengthOrd(conf, t.sons[0])
|
||||
|
||||
Reference in New Issue
Block a user