From 35268c500f2143e757a71846b246a1ecb31c72f8 Mon Sep 17 00:00:00 2001 From: Oscar NihlgÄrd Date: Sat, 31 Aug 2019 19:34:08 +0200 Subject: Fix int literals and range interaction (#11197) * Fix int literals and range interaction * Fix test * remove float range fix; update changelog --- doc/manual.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/manual.rst b/doc/manual.rst index 1f8f23310..a8326d94d 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -2282,9 +2282,11 @@ algorithm returns true: proc isImplicitlyConvertible(a, b: PType): bool = if isSubtype(a, b) or isCovariant(a, b): return true + if isIntLiteral(a): + return b in {int8, int16, int32, int64, int, uint, uint8, uint16, + uint32, uint64, float32, float64} case a.kind - of int: result = b in {int8, int16, int32, int64, uint, uint8, uint16, - uint32, uint64, float, float32, float64} + of int: result = b in {int32, int64} of int8: result = b in {int16, int32, int64, int} of int16: result = b in {int32, int64, int} of int32: result = b in {int64, int} @@ -2292,9 +2294,8 @@ algorithm returns true: of uint8: result = b in {uint16, uint32, uint64} of uint16: result = b in {uint32, uint64} of uint32: result = b in {uint64} - of float: result = b in {float32, float64} - of float32: result = b in {float64, float} - of float64: result = b in {float32, float} + of float32: result = b in {float64} + of float64: result = b in {float32} of seq: result = b == openArray and typeEquals(a.baseType, b.baseType) of array: -- cgit 1.4.1-2-gfad0