summary refs log tree commit diff stats
path: root/compiler/sem.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-11-07 00:25:54 +0100
committerAraq <rumpf_a@web.de>2013-11-07 00:25:54 +0100
commit4cda0861f507c414bfd622a1f759353c2c623941 (patch)
tree9c9987d493eb8f60bac779ae2d21fd4baaa10760 /compiler/sem.nim
parent27ec76dd3a6e3690e8bb0813a9267172ee19b34d (diff)
downloadNim-4cda0861f507c414bfd622a1f759353c2c623941.tar.gz
tcnstseq works again
Diffstat (limited to 'compiler/sem.nim')
-rw-r--r--compiler/sem.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim
index 89f87acaa..ee3df9f6a 100644
--- a/compiler/sem.nim
+++ b/compiler/sem.nim
@@ -187,6 +187,11 @@ proc semConstExpr(c: PContext, n: PNode): PNode =
         LocalError(e.info, errConstExprExpected)
       # error correction:
       result = e
+    else:
+      # recompute the types as 'eval' isn't guaranteed to construct types nor
+      # that the types are sound:
+      result = semExprWithType(c, result)
+      result = fitNode(c, e.typ, result)
 
 include hlo, seminst, semcall