[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
@@ -0,0 +1,40 @@
open class A<A_T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
open class B<B_T : Any?> : A<B_T> {
constructor() /* primary */ {
super/*A*/<B_T>()
/* <init>() */
}
override fun hashCode(): Int {
return 0
}
}
open class C<C_T : Any?> : B<C_T> {
constructor() /* primary */ {
super/*B*/<C_T>()
/* <init>() */
}
}
open class D<D_T : Any?> : C<D_T> {
constructor() /* primary */ {
super/*C*/<D_T>()
/* <init>() */
}
}