Files
kotlin-fork/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterHasHigherAccess.fir.kt
T
Tianyu Geng f35680f0a4 FIR checker: resolve property with protected getter and public setter
Assuming Java class `Super` has a protected `getName` method and a
public `setName` method.

Then, in a subclass of `Super`, FE1.0 allows calls to `setName` via the
property syntax if the property is protected and invisible due to
dispatch receiver is not `this` or `super`.
2021-09-29 19:39:12 +03:00

17 lines
366 B
Kotlin
Vendored

// FILE: KotlinFile.kt
package k
import JavaClass
fun foo(javaClass: JavaClass) {
val v = javaClass.<!INVISIBLE_REFERENCE!>something<!>
javaClass.something = 1
javaClass.<!INVISIBLE_REFERENCE!>something<!>++
}
// FILE: JavaClass.java
public class JavaClass {
protected int getSomething() { return 1; }
public void setSomething(int value) {}
}