FIR2IR: drop hacky computeFieldSymbolForCallableReference

This commit is contained in:
Mikhail Glukhikh
2022-11-29 08:42:55 +01:00
committed by teamcity
parent c7224c643f
commit a60eab7b47
3 changed files with 6 additions and 33 deletions
@@ -45,7 +45,7 @@ FILE fqName:foo fileName:/main.kt
$this: CALL 'public final fun CHECK_NOT_NULL <T0> (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=java.lang.reflect.Field origin=EXCLEXCL
<T0>: java.lang.reflect.Field
arg0: CALL 'public final fun <get-javaField> (): java.lang.reflect.Field? declared in kotlin.reflect.jvm.ReflectJvmMapping' type=java.lang.reflect.Field? origin=GET_PROPERTY
$receiver: PROPERTY_REFERENCE 'protected/*protected and package*/ open a: @[FlexibleNullability] foo.A? [var]' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' getter='protected/*protected and package*/ open fun <get-a> (): @[FlexibleNullability] foo.A? declared in foo.Derived' setter='protected/*protected and package*/ open fun <set-a> (<set-?>: @[FlexibleNullability] foo.A?): kotlin.Unit declared in foo.Derived' type=kotlin.reflect.KMutableProperty1<foo.Derived, @[FlexibleNullability] foo.A?> origin=null
$receiver: PROPERTY_REFERENCE 'protected/*protected and package*/ open a: @[FlexibleNullability] foo.A? [var]' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] foo.A? visibility:protected/*protected and package*/' getter='protected/*protected and package*/ open fun <get-a> (): @[FlexibleNullability] foo.A? declared in bar.Base' setter='protected/*protected and package*/ open fun <set-a> (<set-?>: @[FlexibleNullability] foo.A?): kotlin.Unit declared in bar.Base' type=kotlin.reflect.KMutableProperty1<foo.Derived, @[FlexibleNullability] foo.A?> origin=null
<1>: <none>
<2>: <none>
p0: GET_VAR '<this>: foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null
@@ -24,7 +24,9 @@ class A(val s: String)
class Derived : Base() {
override fun foo() {
// ir: resolved to fake-override field Derived.a
// ir: resolved to fake-override field Derived.a in K1,
// but to base field Base.a in K2
// However, box() works correctly in both cases
(Derived::a).javaField!![this] = A("OK")
}