summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-05-10 08:21:06 +0200
committerAraq <rumpf_a@web.de>2012-05-10 08:21:06 +0200
commit63326f19f077554a2e345f65168005ed38b3a15d (patch)
tree3a723787d38b90f3c91a109d9e68d169de5ad5d6 /compiler
parentccc4ed2c5a928b5e1adc91e7e5c4a6b16032b8ec (diff)
downloadNim-63326f19f077554a2e345f65168005ed38b3a15d.tar.gz
fixes #111; however may introduce other problems
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/semexprs.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 4e9afd585..967d60531 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1305,7 +1305,12 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
   of nkNilLit: 
     result.typ = getSysType(tyNil)
   of nkIntLit: 
-    if result.typ == nil: result.typ = getSysType(tyInt)
+    if result.typ == nil: 
+      let i = result.intVal
+      if i >= low(int32) and i <= high(int32):
+        result.typ = getSysType(tyInt)
+      else:
+        result.typ = getSysType(tyInt64)
   of nkInt8Lit: 
     if result.typ == nil: result.typ = getSysType(tyInt8)
   of nkInt16Lit: