improve error message for bug #6788
This commit is contained in:
parent
a0a460d682
commit
2f17be9c22
1 changed files with 4 additions and 1 deletions
|
|
@ -234,6 +234,9 @@ proc semRange(c: PContext, n: PNode, prev: PType): PType =
|
||||||
elif n.sons[1].kind in {nkFloatLit..nkFloat64Lit} and
|
elif n.sons[1].kind in {nkFloatLit..nkFloat64Lit} and
|
||||||
n.sons[1].floatVal < 0.0:
|
n.sons[1].floatVal < 0.0:
|
||||||
incl(result.flags, tfNeedsInit)
|
incl(result.flags, tfNeedsInit)
|
||||||
|
else:
|
||||||
|
if n[1].kind == nkInfix and considerQuotedIdent(n[1][0]).s == "..<":
|
||||||
|
localError(n[0].info, "range types need to be constructed with '..', '..<' is not supported")
|
||||||
else:
|
else:
|
||||||
localError(n.sons[0].info, errRangeExpected)
|
localError(n.sons[0].info, errRangeExpected)
|
||||||
result = newOrPrevType(tyError, prev, c)
|
result = newOrPrevType(tyError, prev, c)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue