summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-09-14 05:20:30 +0300
committerGitHub <noreply@github.com>2024-09-14 10:20:30 +0800
commit6d362e0ffe78791036af05e4224daebaf7cb3f81 (patch)
treeb5ff7648e7a2a8a2585cd993ea3d460186c66f20 /tests
parent61e04ba0ed4b8c6567f4cfd5c48c2c2439c62371 (diff)
downloadNim-6d362e0ffe78791036af05e4224daebaf7cb3f81.tar.gz
fix regression with uint constant losing abstract type (#24105)
fixes #24104, refs #23955

The line `result.typ = dstTyp` added in #23955 changes the type of
`result`, which was the type of `n` due to the argument passed to
`newIntNodeT`, to the abstract type skipped `dstTyp`. The line is
removed to just keep the type as abstract.
Diffstat (limited to 'tests')
-rw-r--r--tests/int/t1.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/int/t1.nim b/tests/int/t1.nim
index b8d6f9c92..6e5cdc8d4 100644
--- a/tests/int/t1.nim
+++ b/tests/int/t1.nim
@@ -52,3 +52,10 @@ block: # bug #23954
   doAssert testRT_u8 == 7
   const testCT_u8 : uint8 = 0x107.uint8
   doAssert testCT_u8 == 7
+
+block: # issue #24104
+  type P = distinct uint  # uint, uint8, uint16, uint32, uint64 
+  let v = 0.P
+  case v
+  of 0.P: discard
+  else:   discard