mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 02:33:58 +00:00
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.
(cherry picked from commit 6d362e0ffe)
This commit is contained in:
@@ -42,3 +42,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
|
||||
|
||||
Reference in New Issue
Block a user