diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-09-28 09:29:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-28 09:29:09 +0200 |
commit | 959e3a08b16cf10f8e0d3a0ebd5bda07aec91327 (patch) | |
tree | 1cb6aa2b8957f27fa9d42a710682b49ede3b16a7 /compiler | |
parent | baccd1ad81fe1407fcfe95222528bf9bdbdaa3eb (diff) | |
parent | e9b5a4e25dcf7929cbda9e67d1775d3ccda82c57 (diff) | |
download | Nim-959e3a08b16cf10f8e0d3a0ebd5bda07aec91327.tar.gz |
Merge pull request #9085 from LemonBoy/fix-9079
Constant folding should not drop distinct types
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semfold.nim | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 0018f0755..627877cbe 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -37,10 +37,7 @@ proc newIntNodeT*(intVal: BiggestInt, n: PNode; g: ModuleGraph): PNode = proc newFloatNodeT*(floatVal: BiggestFloat, n: PNode; g: ModuleGraph): PNode = result = newFloatNode(nkFloatLit, floatVal) - if skipTypes(n.typ, abstractVarRange).kind == tyFloat: - result.typ = getFloatLitType(g, result) - else: - result.typ = n.typ + result.typ = n.typ result.info = n.info proc newStrNodeT*(strVal: string, n: PNode; g: ModuleGraph): PNode = |