minor code style changes
This commit is contained in:
parent
613ea6e85e
commit
7205c3ebe2
3 changed files with 13 additions and 12 deletions
|
|
@ -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]):
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue