Fix "No error on increment or augmented assignment when 'get' is an operator but 'set' is not" #KT-11300
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
operator fun get(x: Int): Int = x
|
||||
fun set(<!UNUSED_PARAMETER!>x<!>: Int, <!UNUSED_PARAMETER!>y<!>: Int) {} // no `operator` modifier
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = A()
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!>++
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!> += 3
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!> = a[1] + 3
|
||||
}
|
||||
Reference in New Issue
Block a user