minor code style changes

This commit is contained in:
Araq 2020-03-16 09:52:07 +01:00 • committed by Andreas Rumpf
commit 7205c3ebe2
3 changed files with 13 additions and 12 deletions

View file

@ -225,7 +225,7 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType =
if not hasUnknownTypes: if not hasUnknownTypes:
if not sameType(rangeT[0].skipTypes({tyRange}), rangeT[1].skipTypes({tyRange})): if not sameType(rangeT[0].skipTypes({tyRange}), rangeT[1].skipTypes({tyRange})):
localError(c.config, n.info, "type mismatch") localError(c.config, n.info, "type mismatch")
elif not isOrdinalType(rangeT[0]) and rangeT[0].kind notin tyFloat..tyFloat128 or elif not isOrdinalType(rangeT[0]) and rangeT[0].kind notin {tyFloat..tyFloat128} or
rangeT[0].kind == tyBool: rangeT[0].kind == tyBool:
localError(c.config, n.info, "ordinal or float type expected") localError(c.config, n.info, "ordinal or float type expected")
elif enumHasHoles(rangeT[0]): elif enumHasHoles(rangeT[0]):

View file

@ -1618,7 +1618,8 @@ proc isTupleRecursive(t: PType, cycleDetector: var IntSet): bool =
assign(cycleDetectorCopy, cycleDetector) assign(cycleDetectorCopy, cycleDetector)
if isTupleRecursive(t[i], cycleDetectorCopy): if isTupleRecursive(t[i], cycleDetectorCopy):
return true return true
of tyAlias, tyRef, tyPtr, tyGenericInst, tyVar, tyLent, tySink, tyArray, tyUncheckedArray, tySequence: of tyAlias, tyRef, tyPtr, tyGenericInst, tyVar, tyLent, tySink,
tyArray, tyUncheckedArray, tySequence:
return isTupleRecursive(t.lastSon, cycleDetector) return isTupleRecursive(t.lastSon, cycleDetector)
else: else:
return false return false