Fix several float range issues
This commit is contained in:
parent
66a8856152
commit
def6234903
5 changed files with 30 additions and 3 deletions
|
|
@ -414,9 +414,10 @@ proc isConvertibleToRange(f, a: PType): bool =
|
|||
of tyUInt16: result = a.kind in {tyUInt8, tyUInt16, tyUInt}
|
||||
of tyUInt32: result = a.kind in {tyUInt8, tyUInt16, tyUInt32, tyUInt}
|
||||
else: result = false
|
||||
elif f.kind in {tyFloat..tyFloat128} and
|
||||
a.kind in {tyFloat..tyFloat128}:
|
||||
result = true
|
||||
elif f.kind in {tyFloat..tyFloat128}:
|
||||
# `isIntLit` is correct and should be used above as well, see PR:
|
||||
# https://github.com/nim-lang/Nim/pull/11197
|
||||
result = isIntLit(a) or a.kind in {tyFloat..tyFloat128}
|
||||
|
||||
proc handleFloatRange(f, a: PType): TTypeRelation =
|
||||
if a.kind == f.kind:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue