diff options
Diffstat (limited to 'compiler/semexprs.nim')
-rwxr-xr-x | compiler/semexprs.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 6a9af12ab..a82852089 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -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): |