FIR2IR: call fake overrides properly #KT-49288 Fixed

This commit is contained in:
Mikhail Glukhikh
2021-10-12 12:50:35 +03:00
committed by teamcity
parent ec079a2663
commit 5b6e21690b
31 changed files with 128 additions and 245 deletions
+1 -1
View File
@@ -340,7 +340,7 @@ FILE fqName:<root> fileName:/enum.kt
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.TestEnum4.TEST2 declared in <root>.TestEnum4.TEST2' type=<root>.TestEnum4.TEST2 origin=null
value: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.TestEnum4' type=kotlin.Int origin=GET_PROPERTY
value: CALL 'public final fun <get-x> (): kotlin.Int [fake_override] declared in <root>.TestEnum4.TEST2' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.TestEnum4.TEST2 declared in <root>.TestEnum4.TEST2' type=<root>.TestEnum4.TEST2 origin=null
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestEnum4.TEST2) returnType:kotlin.Unit
overridden:
@@ -159,7 +159,7 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (arg: kotlin.String) declared in <root>.A'
arg: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
arg: CALL 'public open fun toString (): kotlin.String [fake_override] declared in kotlin.Int' type=kotlin.String origin=null
$this: GET_VAR 'x: kotlin.Int declared in <root>.A.<init>' type=kotlin.Int origin=null
CALL 'public final fun <set-prop3> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
-77
View File
@@ -1,77 +0,0 @@
FILE fqName:test1 fileName:/kt19306_test1.kt
CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:test1.A
CONSTRUCTOR visibility:public <> () returnType:test1.A [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]'
PROPERTY name:p visibility:protected modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.String visibility:private
EXPRESSION_BODY
CONST String type=kotlin.String value=""
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-p> visibility:protected modality:FINAL <> ($this:test1.A) returnType:kotlin.String
correspondingProperty: PROPERTY name:p visibility:protected modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:test1.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='protected final fun <get-p> (): kotlin.String declared in test1.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.String visibility:private' type=kotlin.String origin=null
receiver: GET_VAR '<this>: test1.A declared in test1.A.<get-p>' type=test1.A origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-p> visibility:private modality:FINAL <> ($this:test1.A, <set-?>:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:p visibility:protected modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:test1.A
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.String visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: test1.A declared in test1.A.<set-p>' type=test1.A origin=null
value: GET_VAR '<set-?>: kotlin.String declared in test1.A.<set-p>' type=kotlin.String origin=null
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 [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FILE fqName:test2 fileName:/kt19306_test2.kt
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[test1.A]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:test2.B
CONSTRUCTOR visibility:public <> () returnType:test2.B [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in test1.A'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[test1.A]'
FUN name:test visibility:public modality:FINAL <> ($this:test2.B) returnType:kotlin.Function0<kotlin.String>
$this: VALUE_PARAMETER name:<this> type:test2.B
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Function0<kotlin.String> declared in test2.B'
FUN_EXPR type=kotlin.Function0<kotlin.String> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in test2.B.test'
CALL 'protected final fun <get-p> (): kotlin.String declared in test1.A' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: test2.B declared in test2.B.test' type=test2.B origin=null
PROPERTY FAKE_OVERRIDE name:p visibility:protected modality:FINAL [fake_override,var]
overridden:
protected final p: kotlin.String [var]
FUN FAKE_OVERRIDE name:<get-p> visibility:protected modality:FINAL <> ($this:test1.A) returnType:kotlin.String [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:p visibility:protected modality:FINAL [fake_override,var]
overridden:
protected final fun <get-p> (): kotlin.String declared in test1.A
$this: VALUE_PARAMETER name:<this> type:test1.A
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 [fake_override,operator] declared in test1.A
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in test1.A
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in test1.A
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// SKIP_KT_DUMP
// FILE: kt19306_test1.kt
package test1