Files
kotlin-fork/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.kt
T
2022-03-11 15:36:05 +03:00

17 lines
303 B
Kotlin
Vendored

// FIR_IDENTICAL
//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
i <!ASSIGN_OPERATOR_AMBIGUITY!>+=<!> 34
}