[FIR Java] Hide function in scope in case it's an accessor by fact

#KT-42116 Fixed
This commit is contained in:
Mikhail Glukhikh
2020-09-24 12:01:04 +03:00
parent 70095712eb
commit fe8e3e99ab
10 changed files with 116 additions and 9 deletions
@@ -0,0 +1,26 @@
// FILE: PropertyDescriptor.java
public interface PropertyDescriptor extends DescriptorWithAccessor {
String getSetter();
boolean isDelegated();
}
// FILE: test.kt
interface DescriptorWithAccessor {
val setter: String
val isDelegated: Boolean
}
class WrappedPropertyDescriptor : PropertyDescriptor {
override val setter: String get() = "K"
override val isDelegated: Boolean get() = false
}
fun test() {
val descriptor = WrappedPropertyDescriptor()
val res1 = descriptor.setter
val res2 = descriptor.<!UNRESOLVED_REFERENCE!>getSetter<!>() // Should be error
val res3 = descriptor.isDelegated
val res4 = descriptor.<!UNRESOLVED_REFERENCE!>isDelegated<!>() // Should be error
}