fixes #111; however may introduce other problems

This commit is contained in:
Araq 2012-05-10 08:21:06 +02:00
commit 63326f19f0

View file

@ -1305,7 +1305,12 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
of nkNilLit: of nkNilLit:
result.typ = getSysType(tyNil) result.typ = getSysType(tyNil)
of nkIntLit: 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: of nkInt8Lit:
if result.typ == nil: result.typ = getSysType(tyInt8) if result.typ == nil: result.typ = getSysType(tyInt8)
of nkInt16Lit: of nkInt16Lit: