diff options
author | metagn <metagngn@gmail.com> | 2024-09-14 05:20:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-14 10:20:30 +0800 |
commit | 6d362e0ffe78791036af05e4224daebaf7cb3f81 (patch) | |
tree | b5ff7648e7a2a8a2585cd993ea3d460186c66f20 /compiler | |
parent | 61e04ba0ed4b8c6567f4cfd5c48c2c2439c62371 (diff) | |
download | Nim-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 'compiler')
-rw-r--r-- | compiler/semfold.nim | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index b2105830e..80144ccc0 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -423,7 +423,6 @@ proc foldConv(n, a: PNode; idgen: IdGenerator; g: ModuleGraph; check = false): P if dstTyp.kind in {tyUInt..tyUInt64}: result = newIntNodeT(maskBytes(val, int 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) |