float64 is now an alias to 'float'; fixes #545
This commit is contained in:
parent
1ad1980f1f
commit
7056ceda67
8 changed files with 50 additions and 19 deletions
|
|
@ -283,14 +283,18 @@ proc isConvertibleToRange(f, a: PType): bool =
|
|||
a.kind in {tyFloat..tyFloat128}:
|
||||
result = true
|
||||
|
||||
proc handleFloatRange(f, a: PType): TTypeRelation =
|
||||
if a.kind == f.kind:
|
||||
proc handleFloatRange(f, a: PType): TTypeRelation =
|
||||
if a.kind == f.kind:
|
||||
result = isEqual
|
||||
else:
|
||||
else:
|
||||
let ab = skipTypes(a, {tyRange})
|
||||
var k = ab.kind
|
||||
if k == f.kind: result = isSubrange
|
||||
elif isFloatLit(ab): result = isFromIntLit
|
||||
elif isIntLit(ab): result = isConvertible
|
||||
elif f.kind == tyFloat32:
|
||||
# no conversion to "float32" as that might lose precision
|
||||
result = isNone
|
||||
elif k >= tyFloat and k <= tyFloat128: result = isConvertible
|
||||
else: result = isNone
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue