FIR2IR: correctly set type parameters of property accessors

In particular, we generate different type parameters for
getters & setters here.
This commit is contained in:
Mikhail Glukhikh
2020-02-25 16:24:23 +03:00
parent 50abb07245
commit 3a3d6e740c
20 changed files with 278 additions and 317 deletions
@@ -8,20 +8,23 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
VALUE_PARAMETER name:a index:0 type:A of <root>.IBase
VALUE_PARAMETER name:b index:1 type:B of <root>.IBase.foo
PROPERTY name:id visibility:public modality:ABSTRACT [val]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-id> visibility:public modality:ABSTRACT <> ($this:<root>.IBase<A of <root>.IBase>, $receiver:C of <uninitialized parent>) returnType:kotlin.collections.Map<A of <root>.IBase, C of <uninitialized parent>>?
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-id> visibility:public modality:ABSTRACT <C> ($this:<root>.IBase<A of <root>.IBase>, $receiver:C of <root>.IBase.<get-id>) returnType:kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>?
correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val]
TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
$receiver: VALUE_PARAMETER name:<this> type:C of <uninitialized parent>
$receiver: VALUE_PARAMETER name:<this> type:C of <root>.IBase.<get-id>
PROPERTY name:x visibility:public modality:ABSTRACT [var]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.IBase<A of <root>.IBase>, $receiver:kotlin.collections.List<D of <uninitialized parent>>) returnType:D of <uninitialized parent>?
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:ABSTRACT <D> ($this:<root>.IBase<A of <root>.IBase>, $receiver:kotlin.collections.List<D of <root>.IBase.<get-x>>) returnType:D of <root>.IBase.<get-x>?
correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var]
TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.List<D of <uninitialized parent>>
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-x> visibility:public modality:ABSTRACT <> ($this:<root>.IBase<A of <root>.IBase>, $receiver:kotlin.collections.List<D of <uninitialized parent>>, <set-?>:D of <uninitialized parent>?) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.List<D of <root>.IBase.<get-x>>
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-x> visibility:public modality:ABSTRACT <D> ($this:<root>.IBase<A of <root>.IBase>, $receiver:kotlin.collections.List<D of <root>.IBase.<get-x>>, <set-?>:D of <root>.IBase.<set-x>?) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var]
TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.List<D of <uninitialized parent>>
VALUE_PARAMETER name:<set-?> index:0 type:D of <uninitialized parent>?
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.List<D of <root>.IBase.<get-x>>
VALUE_PARAMETER name:<set-?> index:0 type:D of <root>.IBase.<set-x>?
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
@@ -51,23 +54,23 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
VALUE_PARAMETER name:a index:0 type:E of <root>.Test1
VALUE_PARAMETER name:b index:1 type:B of <root>.Test1.foo
PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:ABSTRACT <> ($this:<root>.Test1<E of <root>.Test1>) returnType:kotlin.collections.Map<E of <root>.Test1, C of <uninitialized parent>>? [fake_override]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:ABSTRACT <> ($this:<root>.Test1<E of <root>.Test1>) returnType:kotlin.collections.Map<E of <root>.Test1, C of <root>.IBase.<get-id>>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
overridden:
public abstract fun <get-id> (): kotlin.collections.Map<A of <root>.IBase, C of <uninitialized parent>>? declared in <root>.IBase
public abstract fun <get-id> <C> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>? declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.Test1<E of <root>.Test1>
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test1<E of <root>.Test1>) returnType:D of <uninitialized parent>? [fake_override]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test1<E of <root>.Test1>) returnType:D of <root>.IBase.<get-x>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <get-x> (): D of <uninitialized parent>? declared in <root>.IBase
public abstract fun <get-x> <D> (): D of <root>.IBase.<get-x>? declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.Test1<E of <root>.Test1>
FUN FAKE_OVERRIDE name:<set-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test1<E of <root>.Test1>, <set-?>:D of <uninitialized parent>?) returnType:kotlin.Unit [fake_override]
FUN FAKE_OVERRIDE name:<set-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test1<E of <root>.Test1>, <set-?>:D of <root>.IBase.<set-x>?) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <set-x> (<set-?>: D of <uninitialized parent>?): kotlin.Unit declared in <root>.IBase
public abstract fun <set-x> <D> (<set-?>: D of <root>.IBase.<set-x>?): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.Test1<E of <root>.Test1>
VALUE_PARAMETER name:<set-?> index:0 type:D of <uninitialized parent>?
VALUE_PARAMETER name:<set-?> index:0 type:D of <root>.IBase.<set-x>?
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
@@ -115,23 +118,23 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
VALUE_PARAMETER name:a index:0 type:kotlin.String
VALUE_PARAMETER name:b index:1 type:B of <root>.Test2.foo
PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:ABSTRACT <> ($this:<root>.Test2) returnType:kotlin.collections.Map<kotlin.String, C of <uninitialized parent>>? [fake_override]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:ABSTRACT <> ($this:<root>.Test2) returnType:kotlin.collections.Map<kotlin.String, C of <root>.IBase.<get-id>>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
overridden:
public abstract fun <get-id> (): kotlin.collections.Map<A of <root>.IBase, C of <uninitialized parent>>? declared in <root>.IBase
public abstract fun <get-id> <C> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>? declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test2) returnType:D of <uninitialized parent>? [fake_override]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test2) returnType:D of <root>.IBase.<get-x>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <get-x> (): D of <uninitialized parent>? declared in <root>.IBase
public abstract fun <get-x> <D> (): D of <root>.IBase.<get-x>? declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
FUN FAKE_OVERRIDE name:<set-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test2, <set-?>:D of <uninitialized parent>?) returnType:kotlin.Unit [fake_override]
FUN FAKE_OVERRIDE name:<set-x> visibility:public modality:ABSTRACT <> ($this:<root>.Test2, <set-?>:D of <root>.IBase.<set-x>?) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <set-x> (<set-?>: D of <uninitialized parent>?): kotlin.Unit declared in <root>.IBase
public abstract fun <set-x> <D> (<set-?>: D of <root>.IBase.<set-x>?): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
VALUE_PARAMETER name:<set-?> index:0 type:D of <uninitialized parent>?
VALUE_PARAMETER name:<set-?> index:0 type:D of <root>.IBase.<set-x>?
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