diff options
author | LemonBoy <thatlemon@gmail.com> | 2018-09-27 17:08:01 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2018-09-27 17:08:01 +0200 |
commit | e9b5a4e25dcf7929cbda9e67d1775d3ccda82c57 (patch) | |
tree | 5ee3c5b9d78994334aa7a40c0debec59b921f71a /compiler/semfold.nim | |
parent | 72e15ff739cc73fbf6e3090756d3f9cb3d5af2fa (diff) | |
download | Nim-e9b5a4e25dcf7929cbda9e67d1775d3ccda82c57.tar.gz |
Constant folding should not drop distinct types
Fixes #9079
Diffstat (limited to 'compiler/semfold.nim')
-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 = |