summary refs log tree commit diff stats
path: root/tests/int/t1.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-08-13 20:02:52 +0800
committerGitHub <noreply@github.com>2024-08-13 14:02:52 +0200
commitddc47feccadf23423d969e970b816b9808335769 (patch)
tree54d63a3d3e3a269394faf8c35401cae3cd430ede /tests/int/t1.nim
parentc5b206d4ac6704147d9ec27506b9d0171f3a9501 (diff)
downloadNim-ddc47feccadf23423d969e970b816b9808335769.tar.gz
fixes #23947; .uint8 compile-time error (#23948)
fixes #23947
Diffstat (limited to 'tests/int/t1.nim')
-rw-r--r--tests/int/t1.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/int/t1.nim b/tests/int/t1.nim
index d08f5f29b..f1d6c9a18 100644
--- a/tests/int/t1.nim
+++ b/tests/int/t1.nim
@@ -17,6 +17,16 @@ doAssert typeOf(myInt16 + 2i32) is int32  # of type `int32`
 doAssert int32 isnot int64
 doAssert int32 isnot int
 
+block: # bug #23947
+  template foo =
+    let test_u64 : uint64 =   0xFF07.uint64
+    let test_u8  : uint8  = test_u64.uint8
+        # Error: illegal conversion from '65287' to '[0..255]'
+    doAssert test_u8 == 7
+
+  static: foo()
+  foo()
+
 block:
   # bug #22085
   const