JVM: KT-40665 more exact check for intrinsified range 'contains'

This commit is contained in:
Dmitry Petrov
2020-07-29 11:38:32 +03:00
parent 0559e192ee
commit f2493d0950
10 changed files with 61 additions and 5 deletions
@@ -0,0 +1,12 @@
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
operator fun ClosedRange<Int>.contains(value: Long) = false
operator fun ClosedRange<UInt>.contains(value: ULong) = false
fun box(): String {
if (10L in 1..10) return "Failed: Long in Int..Int"
if (10UL in 1U..10U) return "Failed: ULong in UInt..UInt"
return "OK"
}