Handle Java base class field read properly in IR converters

For FE 1.0, we just change super qualifier symbol to
base class, if it's possible.
For FIR, we introduce using of super qualifier symbols for
field accesses and repeat FE 1.0 behavior here.

#KT-49507 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-06-08 14:45:52 +02:00
committed by Space
parent c2ae74c7cd
commit b0a6508d4b
23 changed files with 370 additions and 18 deletions
@@ -0,0 +1,23 @@
// SKIP_KLIB_TEST
// Related to KT-49507
// FILE: A.java
public class A {
protected String x = "1";
protected String y = "2";
public static class B extends A {
protected String y = "3";
}
}
// FILE: test.kt
package test
fun <T> eval(f: () -> T) = f()
class C : A.B() {
// Both x & y here should in fact be taken from B class: this.(super<B>.x), this.(super<B>.y)
fun f() = eval { x }
fun g() = eval { y }
}