[FIR] Fix exponential analysis of augmented array access calls
^KT-50861 Fixed
This commit is contained in:
committed by
teamcity
parent
c4735f9f29
commit
ade2307345
+1
-1
@@ -16,4 +16,4 @@ fun withVararg(vararg xs: Int) = 42
|
||||
|
||||
fun test1() {
|
||||
A[::withVararg] += 1
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@ fun testArrayAssignment4(n: Nothing) {
|
||||
|
||||
fun testArrayPlusAssign(array: Array<Any>) {
|
||||
operator fun Any.plusAssign(a: Any) {}
|
||||
array[1] <!UNREACHABLE_CODE!>+=<!> todo()
|
||||
<!UNREACHABLE_CODE!>array<!><!UNREACHABLE_CODE!>[<!><!UNREACHABLE_CODE!>1<!><!UNREACHABLE_CODE!>] +=<!> todo()
|
||||
}
|
||||
|
||||
fun todo(): Nothing = throw Exception()
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object RemAndRemAssign {
|
||||
operator fun rem(x: Int) = RemAndRemAssign
|
||||
}
|
||||
|
||||
operator fun RemAndRemAssign.remAssign(x: Int) {}
|
||||
|
||||
fun test() {
|
||||
var c = RemAndRemAssign
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>c %= 1<!>
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object RemAndRemAssign {
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
//KT-1820 Write test for ASSIGN_OPERATOR_AMBIGUITY
|
||||
package kt1820
|
||||
|
||||
class MyInt(val i: Int) {
|
||||
operator fun plus(m: MyInt) : MyInt = MyInt(m.i + i)
|
||||
}
|
||||
|
||||
operator fun Any.plusAssign(a: Any) {}
|
||||
|
||||
fun test(m: MyInt) {
|
||||
m += m
|
||||
|
||||
var i = 1
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>i += 34<!>
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
//KT-1820 Write test for ASSIGN_OPERATOR_AMBIGUITY
|
||||
package kt1820
|
||||
|
||||
|
||||
+1
-1
@@ -40,6 +40,6 @@ fun testMismatchingArities() {
|
||||
|
||||
<!NO_VALUE_FOR_PARAMETER!>++MismatchingArities2[0]<!>
|
||||
<!NO_VALUE_FOR_PARAMETER!>MismatchingArities2[0]++<!>
|
||||
<!NO_VALUE_FOR_PARAMETER!>MismatchingArities2[0]<!> <!UNRESOLVED_REFERENCE!>+=<!> 1
|
||||
<!NO_VALUE_FOR_PARAMETER!>MismatchingArities2[0]<!> += 1
|
||||
}
|
||||
|
||||
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
operator fun get(i: Int): C = this
|
||||
}
|
||||
|
||||
operator fun C.plus(a: Any): C = this
|
||||
operator fun C.plusAssign(a: Any) {}
|
||||
|
||||
class C1 {
|
||||
operator fun get(i: Int): C = C()
|
||||
operator fun set(i: Int, v: C) {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val c = C()
|
||||
c[0] += ""
|
||||
var c1 = C1()
|
||||
c1[0] <!OVERLOAD_RESOLUTION_AMBIGUITY!>+=<!> ""
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C
|
||||
|
||||
operator fun C.plus(a: Any): C = this
|
||||
operator fun C.plusAssign(a: Any) {}
|
||||
|
||||
fun test() {
|
||||
val c = C()
|
||||
c += ""
|
||||
var c1 = C()
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>c1 += ""<!>
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
val c: C = C()
|
||||
}
|
||||
|
||||
operator fun C.plus(a: Any): C = this
|
||||
operator fun C.plusAssign(a: Any) {}
|
||||
|
||||
class C1 {
|
||||
var c: C = C()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val c = C()
|
||||
c.c += ""
|
||||
var c1 = C1()
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>c1.c += ""<!>
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
|
||||
Reference in New Issue
Block a user