[FIR2IR] Properly calculate dispatch receiver type for fake overrides

If some function is not fake-override, then its type should be just
  default type of containing class
For fake overrides the default type calculated in the following way:
1. Find first overridden function, which is not fake override
2. Take its containing class
3. Find supertype of current containing class with type constructor of
   class from step 2

^KT-60252 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-08-24 14:40:29 +03:00
committed by Space Team
parent e28f97cf6d
commit d4f55894b4
75 changed files with 1866 additions and 2794 deletions
@@ -129,11 +129,11 @@ FILE fqName:<root> fileName:/genericClassInDifferentModule_m2.kt
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
overridden:
public final x: T of <root>.Base
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Base<T of <root>.Base>) returnType:T of <root>.Derived1 [fake_override]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Base<T of <root>.Derived1>) returnType:T of <root>.Derived1 [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
overridden:
public final fun <get-x> (): T of <root>.Base declared in <root>.Base
$this: VALUE_PARAMETER name:<this> type:<root>.Base<T of <root>.Base>
$this: VALUE_PARAMETER name:<this> type:<root>.Base<T of <root>.Derived1>
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Base