K2 resolve: prefer derived class property to base class field
#KT-50082 Fixed
This commit is contained in:
committed by
teamcity
parent
642bbd38ba
commit
59bafedd8a
+20
@@ -0,0 +1,20 @@
|
||||
// FILE: Test.java
|
||||
|
||||
public class Test {
|
||||
protected final String text = "ABCD";
|
||||
|
||||
public final String publicPrivateText = "ZYXW";
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class Test2 : Test() {
|
||||
private val text = "BCDE"
|
||||
|
||||
private val publicPrivateText = "YXWV"
|
||||
|
||||
fun check() = text // Should be resolved to Test2.text, not to Test.text
|
||||
}
|
||||
|
||||
fun check() = Test2().publicPrivateText // Should be resolved to Test.publicPrivateText (Test2 member is private)
|
||||
|
||||
Reference in New Issue
Block a user