This commit is contained in:
Araq 2018-08-04 20:10:03 +02:00
commit 96c6c82d55
2 changed files with 10 additions and 2 deletions

View file

@ -2127,7 +2127,7 @@ 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, tyLent, tyOrdinal, tyAlias, tySink})
if not isOrdinalType(typ):
if not isOrdinalType(typ, allowEnumWithHoles=true):
localError(c.config, n.info, errOrdinalTypeExpected)
typ = makeRangeType(c, 0, MaxSetElements-1, n.info)
elif lengthOrd(c.config, typ) > MaxSetElements: