[FIR] add support for generic cases of delegation by implementation

Add type parameters for generic delegated members and type
substitution when implementing instantiated super interfaces.
This commit is contained in:
Juan Chen
2020-06-08 23:45:10 -07:00
committed by Mikhail Glukhikh
parent 93632d2a18
commit 2ea3579281
7 changed files with 109 additions and 46 deletions
@@ -59,19 +59,20 @@ FILE fqName:<root> fileName:/delegatedMembers.kt
CALL 'public abstract fun <get-bar> (): kotlin.Int declared in <root>.IBase' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]' type=<root>.IBase<TT of <root>.Test> origin=null
receiver: GET_VAR '<this>: <root>.Test<TT of <root>.Test> declared in <root>.Test.<get-bar>' type=<root>.Test<TT of <root>.Test> origin=null
FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:<root>.Test<TT of <root>.Test>, t:T of <root>.IBase, x:X of <root>.IBase.qux) returnType:kotlin.Unit
FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <X> ($this:<root>.Test<TT of <root>.Test>, t:TT of <root>.Test, x:X of <root>.Test.qux) returnType:kotlin.Unit
overridden:
public abstract fun qux <X> (t: T of <root>.IBase, x: X of <root>.IBase.qux): kotlin.Unit declared in <root>.IBase
TYPE_PARAMETER DELEGATED_MEMBER name:X index:0 variance: superTypes:[]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test<TT of <root>.Test>
VALUE_PARAMETER DELEGATED_MEMBER name:t index:0 type:T of <root>.IBase
VALUE_PARAMETER DELEGATED_MEMBER name:x index:1 type:X of <root>.IBase.qux
VALUE_PARAMETER DELEGATED_MEMBER name:t index:0 type:TT of <root>.Test
VALUE_PARAMETER DELEGATED_MEMBER name:x index:1 type:X of <root>.Test.qux
BLOCK_BODY
CALL 'public abstract fun qux <X> (t: T of <root>.IBase, x: X of <root>.IBase.qux): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
<X>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]' type=<root>.IBase<TT of <root>.Test> origin=null
receiver: GET_VAR '<this>: <root>.Test<TT of <root>.Test> declared in <root>.Test.qux' type=<root>.Test<TT of <root>.Test> origin=null
t: GET_VAR 't: T of <root>.IBase declared in <root>.Test.qux' type=T of <root>.IBase origin=null
x: GET_VAR 'x: X of <root>.IBase.qux declared in <root>.Test.qux' type=X of <root>.IBase.qux origin=null
t: GET_VAR 't: TT of <root>.Test declared in <root>.Test.qux' type=TT of <root>.Test origin=null
x: GET_VAR 'x: X of <root>.Test.qux declared in <root>.Test.qux' type=X of <root>.Test.qux origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden: