01c16ed736
^KT-64570
763 B
763 B
Inner classes
The basic problematic example looks like this:
class A(val x: Int) {
inner class B {
inline fun foo() = x
}
}
fun main() {
A(5).B().foo()
}
The problem is caused by the fact that there is no field, which stores A object inside B doesn't exist after Fir2IR. This field is added by lowering (which is now exectued before inlining, but probably should be moved after), and is a private one. This leads to two problems
- This field doesn't exist in klib
- Even if it exists, it shouldn't have a public signature, so can't be referenced from other klib.
There is a possibility that we can deprecate accessing this of outer class from public inline functions. This would make fixing things a bit easier here.