Setup overridability rules for properties built on Java fields
- They overrides each other - They do not overrides Kotlin propeties and vice versa
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// FILE: B.java
|
||||
|
||||
abstract class B implements A {
|
||||
private int size = 1;
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
interface A {
|
||||
val size: Int
|
||||
}
|
||||
|
||||
class C : B() {
|
||||
override val size: Int get() = 1
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
C().size
|
||||
}
|
||||
Reference in New Issue
Block a user