diff --git a/compiler/testData/diagnostics/tests/QualifiedExpressions.kt b/compiler/testData/diagnostics/tests/QualifiedExpressions.kt index ad1da7d0a35..d79a961fd84 100644 --- a/compiler/testData/diagnostics/tests/QualifiedExpressions.kt +++ b/compiler/testData/diagnostics/tests/QualifiedExpressions.kt @@ -6,7 +6,7 @@ fun test(s: IntRange?) { val c: Int = s?.start ?: -11 val d: Int = s?.start ?: "empty" val e: String = s?.start ?: "empty" - val f: Int = s?.end ?: b ?: 1 + val f: Int = s?.endInclusive ?: b ?: 1 val g: Boolean? = e.startsWith("s")//?.length } diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt index 860f0a11fa3..c19cb196d95 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt @@ -9,6 +9,6 @@ fun test(a1: A, a2: A) { } -public operator fun > T.rangeTo(that: T): Range { +public operator fun > T.rangeTo(that: T): ClosedRange { throw UnsupportedOperationException() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt index 2e82e70baa3..6ae656dfa38 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt @@ -2,7 +2,7 @@ package package a { public fun test(/*0*/ a1: a.A, /*1*/ a2: a.A): kotlin.Unit - public operator fun > T.rangeTo(/*0*/ that: T): kotlin.Range + public operator fun > T.rangeTo(/*0*/ that: T): kotlin.ClosedRange public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt index 8016216964a..e2042693f2f 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -RECURSION_IN_INLINE -inline operator fun Function1.rangeTo(p: Function1): Range { +inline operator fun Function1.rangeTo(p: Function1): ClosedRange { this..p p..this return 1..2 @@ -12,11 +12,11 @@ inline fun inlineFunWithInvoke(s: (p: T) -> U) { } -operator fun Function2.rangeTo(p: Function2): Range { +operator fun Function2.rangeTo(p: Function2): ClosedRange { return 1..2 } -operator fun @Extension Function3.rangeTo(ext: @Extension Function3): Range { +operator fun @Extension Function3.rangeTo(ext: @Extension Function3): ClosedRange { return 1..2 } diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt index 00101b4ec31..e0723e0497a 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt @@ -2,6 +2,6 @@ package public inline fun inlineFunWithInvoke(/*0*/ s: (T) -> U): kotlin.Unit public inline fun inlineFunWithInvoke(/*0*/ s: (T, U) -> U, /*1*/ ext: T.(U, U) -> V): kotlin.Unit -public operator inline fun ((T) -> U).rangeTo(/*0*/ p: (T) -> U): kotlin.Range -public operator fun ((T, U) -> V).rangeTo(/*0*/ p: (T, U) -> V): kotlin.Range -public operator fun (T.(U, V) -> W).rangeTo(/*0*/ ext: T.(U, V) -> W): kotlin.Range +public operator inline fun ((T) -> U).rangeTo(/*0*/ p: (T) -> U): kotlin.ClosedRange +public operator fun ((T, U) -> V).rangeTo(/*0*/ p: (T, U) -> V): kotlin.ClosedRange +public operator fun (T.(U, V) -> W).rangeTo(/*0*/ ext: T.(U, V) -> W): kotlin.ClosedRange diff --git a/idea/testData/checker/QualifiedExpressions.kt b/idea/testData/checker/QualifiedExpressions.kt index cb9d14aa719..7307c624b9e 100644 --- a/idea/testData/checker/QualifiedExpressions.kt +++ b/idea/testData/checker/QualifiedExpressions.kt @@ -6,7 +6,7 @@ fun test(s: IntRange?) { val c: Int = s?.start ?: -11 val d: Int = s?.start ?: "empty" val e: String = s?.start ?: "empty" - val f: Int = s?.end ?: b ?: 1 + val f: Int = s?.endInclusive ?: b ?: 1 val g: Boolean? = e.startsWith("s")//?.length }