summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorOscar NihlgÄrd <oscarnihlgard@gmail.com>2019-08-31 19:34:08 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-08-31 19:34:08 +0200
commit35268c500f2143e757a71846b246a1ecb31c72f8 (patch)
treeb843a8b5c75dc0b5530a1361f1456dcdc05c83de /doc
parent6e01be34efd60869c7905b1effcc47880cedfb6d (diff)
downloadNim-35268c500f2143e757a71846b246a1ecb31c72f8.tar.gz
Fix int literals and range interaction (#11197)
* Fix int literals and range interaction

* Fix test

* remove float range fix; update changelog
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.rst11
1 files changed, 6 insertions, 5 deletions
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: