Files
kotlin-fork/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/augmentedAssignment.kt
T
Mark Punzalan d1531f9cdd FIR: Choose a resolved candidate for augmented assignment when both
assign and operator candidates are unsuccessful.
2021-06-03 20:18:04 +03:00

19 lines
275 B
Kotlin
Vendored

// FIR_IDENTICAL
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()
}