File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,18 @@ operator fun Double.rangeUntil(that: Double): OpenEndRange<Double>
181
181
operator fun Float.rangeUntil (that : Float ): OpenEndRange <Float >
182
182
```
183
183
184
+ ### Equality of open-ended ranges
185
+
186
+ Similar to closed ranges, the ` OpenEndRange ` interface does not specify contract for ` equals ` /` hashCode ` implementations,
187
+ however its concrete implementations can do that. For example, an open-ended range of double values equal to another such range
188
+ when bounds are respectively equal to each other, or to any empty range of doubles, when it is empty itself.
189
+
190
+ Also, as a consequence of implementing both ` OpenEndRange ` and ` ClosedRange ` in concrete range implementations for standard discrete types,
191
+ an open-ended range is equal to the closed range with the same ` start ` value and ` endExclusive ` equal to ` endInclusive + 1 ` :
192
+ ``` kotlin
193
+ 0 .. < 10 == 0 .. 9 // true
194
+ ```
195
+
184
196
## Experimental status
185
197
186
198
Both the language feature of ` rangeUntil ` operator and its supporting standard library API
You can’t perform that action at this time.
0 commit comments