style fixes, typos
This commit is contained in:
parent
4619ee7058
commit
77f33db3ed
2 changed files with 6 additions and 6 deletions
|
|
@ -633,12 +633,12 @@ proc procTypeRel(c: var TCandidate, f, a: PType): TTypeRelation =
|
||||||
else: discard
|
else: discard
|
||||||
|
|
||||||
proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} =
|
proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} =
|
||||||
template checkRange[T](afirst, alast, ffirst, flast: T): TTypeRelation =
|
template checkRange[T](a0, a1, f0, f1: T): TTypeRelation =
|
||||||
if afirst == ffirst and alast == flast:
|
if a0 == f0 and a1 == f1:
|
||||||
isEqual
|
isEqual
|
||||||
elif afirst >= ffirst and alast <= flast:
|
elif a0 >= f0 and a1 <= f1:
|
||||||
isConvertible
|
isConvertible
|
||||||
elif afirst <= flast and ffirst <= a_last:
|
elif a0 <= f1 and f0 <= a1:
|
||||||
# X..Y and C..D overlap iff (X <= D and C <= Y)
|
# X..Y and C..D overlap iff (X <= D and C <= Y)
|
||||||
isConvertible
|
isConvertible
|
||||||
else:
|
else:
|
||||||
|
|
@ -647,7 +647,7 @@ proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} =
|
||||||
if f.isOrdinalType:
|
if f.isOrdinalType:
|
||||||
checkRange(firstOrd(a), lastOrd(a), firstOrd(f), lastOrd(f))
|
checkRange(firstOrd(a), lastOrd(a), firstOrd(f), lastOrd(f))
|
||||||
else:
|
else:
|
||||||
check_range(firstFloat(a), lastFloat(a), firstFloat(f), lastFloat(f))
|
checkRange(firstFloat(a), lastFloat(a), firstFloat(f), lastFloat(f))
|
||||||
|
|
||||||
|
|
||||||
proc matchUserTypeClass*(m: var TCandidate; ff, a: PType): PType =
|
proc matchUserTypeClass*(m: var TCandidate; ff, a: PType): PType =
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ For further details, see `Convertible relation
|
||||||
|
|
||||||
Subrange types
|
Subrange types
|
||||||
--------------
|
--------------
|
||||||
A subrange type is a range of values from an ordinal or float point type (the base
|
A subrange type is a range of values from an ordinal or floating point type (the base
|
||||||
type). To define a subrange type, one must specify it's limiting values: the
|
type). To define a subrange type, one must specify it's limiting values: the
|
||||||
lowest and highest value of the type:
|
lowest and highest value of the type:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue