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:
metagn
2024-09-14 05:20:30 +03:00
committed by narimiran
parent 8bc8347f02
commit fd1d008cce
2 changed files with 7 additions and 1 deletions

View File

@@ -412,7 +412,6 @@ proc foldConv(n, a: PNode; idgen: IdGenerator; g: ModuleGraph; check = false): P
if dstTyp.kind in {tyUInt..tyUInt64}:
result = newIntNodeT(maskBytes(val, getSize(g.config, dstTyp)), n, idgen, g)
result.transitionIntKind(nkUIntLit)
result.typ = dstTyp
else:
if check: rangeCheck(n, val, g)
result = newIntNodeT(val, n, idgen, g)