KT-11203: report errors on read-write operations for elements of collections with inconsistent get&set signatures

This commit is contained in:
Dmitry Petrov
2016-03-01 17:37:45 +03:00
parent cd91e44451
commit 3ca4097bcc
7 changed files with 128 additions and 6 deletions
@@ -0,0 +1,11 @@
object A {
operator fun get(i: Int) = 1
operator fun set(i: Int, j: Int) {}
operator fun set(i: Int, x: Any) { throw Exception() }
}
fun box(): String {
A[0]++
A[0] += 1
return "OK"
}