6a1566a6dc
0. Such properties are called special because their accessor JVM name differs from usual one
1. When making call to such property, always choose special name
2. When generating Kotlin class inheriting such property generate `final bridge int size() { return this.getSize(); }`
3. If there is no `size` declaration in current class generate `bridge int getSize() { // super-call }`
11 lines
198 B
Kotlin
Vendored
11 lines
198 B
Kotlin
Vendored
class A : java.util.ArrayList<String>() {
|
|
override val size: Int get() = super.size + 56
|
|
}
|
|
|
|
fun box(): String {
|
|
val a = A()
|
|
if (a.size != 56) return "fail: ${a.size}"
|
|
|
|
return "OK"
|
|
}
|