fixes #111; however may introduce other problems
This commit is contained in:
parent
ccc4ed2c5a
commit
63326f19f0
1 changed files with 6 additions and 1 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue