some progress for #1082
This commit is contained in:
parent
2c97242739
commit
042ffed6c4
2 changed files with 11 additions and 5 deletions
|
|
@ -194,10 +194,15 @@ proc semRange(c: PContext, n: PNode, prev: PType): PType =
|
||||||
if isRange(n[1]):
|
if isRange(n[1]):
|
||||||
result = semRangeAux(c, n[1], prev)
|
result = semRangeAux(c, n[1], prev)
|
||||||
let n = result.n
|
let n = result.n
|
||||||
if n.sons[0].kind in {nkCharLit..nkUInt64Lit}:
|
if n.sons[0].kind in {nkCharLit..nkUInt64Lit} and n.sons[0].intVal > 0:
|
||||||
if n.sons[0].intVal > 0 or n.sons[1].intVal < 0:
|
|
||||||
incl(result.flags, tfNeedsInit)
|
incl(result.flags, tfNeedsInit)
|
||||||
elif n.sons[0].floatVal > 0.0 or n.sons[1].floatVal < 0.0:
|
elif n.sons[1].kind in {nkCharLit..nkUInt64Lit} and n.sons[1].intVal < 0:
|
||||||
|
incl(result.flags, tfNeedsInit)
|
||||||
|
elif n.sons[0].kind in {nkFloatLit..nkFloat64Lit} and
|
||||||
|
n.sons[0].floatVal > 0.0:
|
||||||
|
incl(result.flags, tfNeedsInit)
|
||||||
|
elif n.sons[1].kind in {nkFloatLit..nkFloat64Lit} and
|
||||||
|
n.sons[1].floatVal < 0.0:
|
||||||
incl(result.flags, tfNeedsInit)
|
incl(result.flags, tfNeedsInit)
|
||||||
else:
|
else:
|
||||||
localError(n.sons[0].info, errRangeExpected)
|
localError(n.sons[0].info, errRangeExpected)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ new(a)
|
||||||
q(a)
|
q(a)
|
||||||
|
|
||||||
# bug #914
|
# bug #914
|
||||||
var x = newWideCString("Hello")
|
when defined(windows):
|
||||||
|
var x = newWideCString("Hello")
|
||||||
|
|
||||||
echo "success"
|
echo "success"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue