FIR: Report UNSAFE_OPERATOR_CALL for augmented assignments (was
reporting UNSAFE_CALL).
This commit is contained in:
committed by
teamcityserver
parent
ef923d4cfe
commit
32bb64a225
+17
@@ -0,0 +1,17 @@
|
||||
class A {
|
||||
operator fun plusAssign(s: String) {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
var a: A? = A()
|
||||
a <!UNSAFE_OPERATOR_CALL!>+=<!> ""
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun plus(other: B) = this
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
var b: B? = B()
|
||||
b <!UNRESOLVED_REFERENCE!>+=<!> B()
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
class A {
|
||||
operator fun plusAssign(s: String) {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
var a: A? = A()
|
||||
a <!UNSAFE_OPERATOR_CALL!>+=<!> ""
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun plus(other: B) = this
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
var b: B? = B()
|
||||
b <!UNSAFE_OPERATOR_CALL!>+=<!> B()
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun test2(): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun plusAssign(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final operator fun plus(/*0*/ other: B): B
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user