conversions to float32 are allowed again but of lower priority

This commit is contained in:
Araq 2013-08-30 21:40:47 +02:00
commit 74c24f3e6d

View file

@ -293,9 +293,9 @@ proc handleFloatRange(f, a: PType): TTypeRelation =
elif isFloatLit(ab): result = isFromIntLit elif isFloatLit(ab): result = isFromIntLit
elif isIntLit(ab): result = isConvertible elif isIntLit(ab): result = isConvertible
elif f.kind == tyFloat32: elif f.kind == tyFloat32:
# no conversion to "float32" as that might lose precision # conversion to "float32" is not as good:
result = isNone result = isConvertible
elif k >= tyFloat and k <= tyFloat128: result = isConvertible elif k >= tyFloat and k <= tyFloat128: result = isIntConv
else: result = isNone else: result = isNone
proc isObjectSubtype(a, f: PType): int = proc isObjectSubtype(a, f: PType): int =