[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:
committed by
Space Team
parent
e28f97cf6d
commit
d4f55894b4
+36
-36
@@ -109,54 +109,54 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): <root>.MyEnum.Z.anObject.<no name provided> declared in <root>.MyEnum.Z'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:<root>.MyEnum.Z.anObject.<no name provided> visibility:private [final]' type=<root>.MyEnum.Z.anObject.<no name provided> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-anObject>' type=<root>.MyEnum.Z origin=null
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Any [fake_override]
|
||||
overridden:
|
||||
protected final fun clone (): kotlin.Any declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:<root>.MyEnum) returnType:kotlin.Int [fake_override,operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>, other:<root>.MyEnum) returnType:kotlin.Int [fake_override,operator]
|
||||
overridden:
|
||||
public final fun compareTo (other: <root>.MyEnum): kotlin.Int declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
VALUE_PARAMETER name:other index:0 type:<root>.MyEnum
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public final fun hashCode (): kotlin.Int declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
annotations:
|
||||
IntrinsicConstEvaluation
|
||||
overridden:
|
||||
public final name: kotlin.String
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.String [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-name> (): kotlin.String declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final ordinal: kotlin.Int
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Int [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyEnum?>? [fake_override]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyEnum?>? [fake_override]
|
||||
overridden:
|
||||
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyEnum?>? declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Unit [fake_override]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in <root>.MyEnum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.MyEnum>
|
||||
SYNTHETIC_BODY kind=ENUM_VALUES
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.MyEnum
|
||||
@@ -166,51 +166,51 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:<get-entries> visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<<root>.MyEnum>
|
||||
correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val]
|
||||
SYNTHETIC_BODY kind=ENUM_ENTRIES
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Any [fake_override]
|
||||
overridden:
|
||||
protected final fun clone (): kotlin.Any declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:<root>.MyEnum) returnType:kotlin.Int [fake_override,operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>, other:<root>.MyEnum) returnType:kotlin.Int [fake_override,operator]
|
||||
overridden:
|
||||
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
VALUE_PARAMETER name:other index:0 type:<root>.MyEnum
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
annotations:
|
||||
IntrinsicConstEvaluation
|
||||
overridden:
|
||||
public final name: kotlin.String
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.String [fake_override]
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.String [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-name> (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final ordinal: kotlin.Int
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Int [fake_override]
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Int [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyEnum?>? [fake_override]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.MyEnum?>? [fake_override]
|
||||
overridden:
|
||||
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Unit [fake_override]
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<<root>.MyEnum>) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.MyEnum>
|
||||
|
||||
Reference in New Issue
Block a user