FIR2IR: populate overriddenSymbols for overriding functions

#KT-38416 Fixed
This commit is contained in:
Jinseong Jeon
2020-04-23 23:57:47 -07:00
committed by Mikhail Glukhikh
parent b51649dcc6
commit 57fe01c375
122 changed files with 167 additions and 112 deletions
@@ -30,16 +30,22 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[<root>.IBase]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.BaseImpl, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
overridden:
public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.BaseImpl
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:s index:1 type:kotlin.String
BLOCK_BODY
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.BaseImpl) returnType:kotlin.Int
overridden:
public abstract fun bar (): kotlin.Int declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.BaseImpl
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in <root>.BaseImpl'
CONST Int type=kotlin.Int value=42
FUN name:qux visibility:public modality:FINAL <> ($this:<root>.BaseImpl, $receiver:kotlin.String) returnType:kotlin.Unit
overridden:
public abstract fun qux (): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.BaseImpl
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
BLOCK_BODY
@@ -25,9 +25,13 @@ FILE fqName:<root> fileName:/delegatedImplementationWithExplicitOverride.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[<root>.IFooBar]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.FooBarImpl) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.IFooBar
$this: VALUE_PARAMETER name:<this> type:<root>.FooBarImpl
BLOCK_BODY
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.FooBarImpl) returnType:kotlin.Unit
overridden:
public abstract fun bar (): kotlin.Unit declared in <root>.IFooBar
$this: VALUE_PARAMETER name:<this> type:<root>.FooBarImpl
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
@@ -50,6 +54,8 @@ FILE fqName:<root> fileName:/delegatedImplementationWithExplicitOverride.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.IFooBar]'
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Unit
overridden:
public abstract fun bar (): kotlin.Unit declared in <root>.IFooBar
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFooBar) returnType:kotlin.Unit [fake_override]
+6
View File
@@ -276,6 +276,8 @@ FILE fqName:<root> fileName:/enum.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum3'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[<root>.TestEnum3]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestEnum3.TEST) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.TestEnum3
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum3.TEST
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -385,6 +387,8 @@ FILE fqName:<root> fileName:/enum.kt
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[<root>.TestEnum4]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestEnum4.TEST1) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.TestEnum4
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum4.TEST1
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -455,6 +459,8 @@ FILE fqName:<root> fileName:/enum.kt
value: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.TestEnum4' 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:
public abstract fun foo (): kotlin.Unit declared in <root>.TestEnum4
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum4.TEST2
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -225,6 +225,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestOpenEnum1]'
FUN name:toString visibility:public modality:FINAL <> ($this:<root>.TestOpenEnum1.X1) returnType:kotlin.String
overridden:
public open fun toString (): kotlin.String declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:<root>.TestOpenEnum1.X1
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun toString (): kotlin.String declared in <root>.TestOpenEnum1.X1'
@@ -315,6 +317,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestOpenEnum2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestOpenEnum2.X1) returnType:kotlin.Unit
overridden:
public open fun foo (): kotlin.Unit declared in <root>.TestOpenEnum2
$this: VALUE_PARAMETER name:<this> type:<root>.TestOpenEnum2.X1
BLOCK_BODY
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
@@ -410,6 +414,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestAbstractEnum1]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestAbstractEnum1.X1) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.TestAbstractEnum1
$this: VALUE_PARAMETER name:<this> type:<root>.TestAbstractEnum1.X1
BLOCK_BODY
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<E of kotlin.Enum>) returnType:kotlin.Any [fake_override]
@@ -521,6 +527,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestAbstractEnum2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestAbstractEnum2.X1) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.TestAbstractEnum2.X1
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
@@ -83,6 +83,8 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.A'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Y modality:FINAL visibility:private superTypes:[<root>.A]'
FUN name:f visibility:public modality:FINAL <> ($this:<root>.A.Y) returnType:kotlin.String
overridden:
public open fun f (): kotlin.String declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.A.Y
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in <root>.A.Y'
@@ -300,6 +300,8 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[<root>.Test2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test2.ZERO) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.Test2
$this: VALUE_PARAMETER name:<this> type:<root>.Test2.ZERO
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -355,6 +357,8 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[<root>.Test2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test2.ONE) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.Test2
$this: VALUE_PARAMETER name:<this> type:<root>.Test2.ONE
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -46,6 +46,8 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K2 modality:FINAL visibility:public superTypes:[<root>.JFoo]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K2) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.K2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.K2'
@@ -94,6 +96,8 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K4) returnType:kotlin.String?
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.K4
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String? declared in <root>.K4'
@@ -56,6 +56,8 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.IFoo]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.test2.<no name provided>) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.test2.<no name provided>
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -121,6 +123,8 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Outer.Inner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Outer.test3.<no name provided>) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.Outer.test3.<no name provided>
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -164,6 +168,8 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Outer.Inner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.test4.<no name provided>) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.test4.<no name provided>
BLOCK_BODY
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
@@ -56,6 +56,9 @@ FILE fqName:<root> fileName:/qualifiedSuperCalls.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CBoth modality:FINAL visibility:public superTypes:[<root>.ILeft; <root>.IRight]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.CBoth) returnType:kotlin.Unit
overridden:
public open fun foo (): kotlin.Unit declared in <root>.ILeft
public open fun foo (): kotlin.Unit declared in <root>.IRight
$this: VALUE_PARAMETER name:<this> type:<root>.CBoth
BLOCK_BODY
CALL 'public open fun foo (): kotlin.Unit declared in <root>.ILeft' type=kotlin.Unit origin=null
@@ -41,6 +41,8 @@ FILE fqName:<root> fileName:/superCalls.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Base'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[<root>.Base]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Derived) returnType:kotlin.Unit
overridden:
public open fun foo (): kotlin.Unit declared in <root>.Base
$this: VALUE_PARAMETER name:<this> type:<root>.Derived
BLOCK_BODY
CALL 'public open fun foo (): kotlin.Unit declared in <root>.Base' type=kotlin.Unit origin=null