more improvements for idetools

This commit is contained in:
Araq 2012-07-30 01:24:54 +02:00
commit 976c39cdc9
4 changed files with 17 additions and 9 deletions

View file

@ -1256,10 +1256,10 @@ proc semSetConstr(c: PContext, n: PNode): PNode =
n.sons[i] = semExprWithType(c, n.sons[i])
if typ == nil:
typ = skipTypes(n.sons[i].typ, {tyGenericInst, tyVar, tyOrdinal})
if not isOrdinalType(typ):
if not isOrdinalType(typ):
LocalError(n.info, errOrdinalTypeExpected)
return
if lengthOrd(typ) > MaxSetElements:
typ = makeRangeType(c, 0, MaxSetElements - 1, n.info)
elif lengthOrd(typ) > MaxSetElements:
typ = makeRangeType(c, 0, MaxSetElements - 1, n.info)
addSonSkipIntLit(result.typ, typ)
for i in countup(0, sonsLen(n) - 1):