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
@@ -1,34 +1,40 @@
FILE fqName:<root> fileName:/variableAsFunctionCallWithGenerics.kt
PROPERTY name:gk visibility:public modality:FINAL [val]
FUN name:<get-gk> visibility:public modality:FINAL <> ($receiver:T of <uninitialized parent>) returnType:kotlin.Function0<T of <uninitialized parent>>
FUN name:<get-gk> visibility:public modality:FINAL <T> ($receiver:T of <root>.<get-gk>) returnType:kotlin.Function0<T of <root>.<get-gk>>
correspondingProperty: PROPERTY name:gk visibility:public modality:FINAL [val]
$receiver: VALUE_PARAMETER name:<this> type:T of <uninitialized parent>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence]
$receiver: VALUE_PARAMETER name:<this> type:T of <root>.<get-gk>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-gk> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>'
FUN_EXPR type=kotlin.Function0<T of <uninitialized parent>> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:T of <uninitialized parent>
RETURN type=kotlin.Nothing from='public final fun <get-gk> <T> (): kotlin.Function0<T of <root>.<get-gk>> declared in <root>'
FUN_EXPR type=kotlin.Function0<T of <root>.<get-gk>> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:T of <root>.<get-gk>
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): T of <uninitialized parent> declared in <root>.<get-gk>'
ERROR_CALL 'Unresolved reference: this@R|/gk|' type=T of <uninitialized parent>
FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:T of <uninitialized parent>
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): T of <root>.<get-gk> declared in <root>.<get-gk>'
ERROR_CALL 'Unresolved reference: this@R|/gk|' type=T of <root>.<get-gk>
FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:T of <root>.<get-gk>
VALUE_PARAMETER name:x index:0 type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testGeneric1 (x: kotlin.String): T of <uninitialized parent> declared in <root>'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of <uninitialized parent> origin=INVOKE
$this: ERROR_EXPR 'Cannot bind 1 type arguments to <get-gk> call with 0 type parameters' type=kotlin.Function0<kotlin.String>
RETURN type=kotlin.Nothing from='public final fun testGeneric1 (x: kotlin.String): T of <root>.<get-gk> declared in <root>'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of <root>.<get-gk> origin=INVOKE
$this: CALL 'public final fun <get-gk> <T> (): kotlin.Function0<T of <root>.<get-gk>> declared in <root>' type=kotlin.Function0<kotlin.String> origin=null
<T>: kotlin.String
$receiver: GET_VAR 'x: kotlin.String declared in <root>.testGeneric1' type=kotlin.String origin=null
PROPERTY name:kt26531Val visibility:public modality:FINAL [val]
FUN name:<get-kt26531Val> visibility:public modality:FINAL <> ($receiver:T of <uninitialized parent>) returnType:kotlin.Function0<T of <uninitialized parent>>
FUN name:<get-kt26531Val> visibility:public modality:FINAL <T> ($receiver:T of <root>.<get-kt26531Val>) returnType:kotlin.Function0<T of <root>.<get-kt26531Val>>
correspondingProperty: PROPERTY name:kt26531Val visibility:public modality:FINAL [val]
$receiver: VALUE_PARAMETER name:<this> type:T of <uninitialized parent>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
$receiver: VALUE_PARAMETER name:<this> type:T of <root>.<get-kt26531Val>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-kt26531Val> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>'
FUN_EXPR type=kotlin.Function0<T of <uninitialized parent>> origin=LAMBDA
FUN name:<no name provided> visibility:local modality:FINAL <> () returnType:T of <uninitialized parent>
RETURN type=kotlin.Nothing from='public final fun <get-kt26531Val> <T> (): kotlin.Function0<T of <root>.<get-kt26531Val>> declared in <root>'
FUN_EXPR type=kotlin.Function0<T of <root>.<get-kt26531Val>> origin=LAMBDA
FUN name:<no name provided> visibility:local modality:FINAL <> () returnType:T of <root>.<get-kt26531Val>
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <no name provided> (): T of <uninitialized parent> declared in <root>.<get-kt26531Val>'
ERROR_CALL 'Unresolved reference: this@R|/kt26531Val|' type=T of <uninitialized parent>
FUN name:kt26531 visibility:public modality:FINAL <> () returnType:T of <uninitialized parent>
RETURN type=kotlin.Nothing from='local final fun <no name provided> (): T of <root>.<get-kt26531Val> declared in <root>.<get-kt26531Val>'
ERROR_CALL 'Unresolved reference: this@R|/kt26531Val|' type=T of <root>.<get-kt26531Val>
FUN name:kt26531 visibility:public modality:FINAL <> () returnType:T of <root>.<get-kt26531Val>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun kt26531 (): T of <uninitialized parent> declared in <root>'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of <uninitialized parent> origin=INVOKE
$this: ERROR_EXPR 'Cannot bind 1 type arguments to <get-kt26531Val> call with 0 type parameters' type=kotlin.Function0<kotlin.Int>
RETURN type=kotlin.Nothing from='public final fun kt26531 (): T of <root>.<get-kt26531Val> declared in <root>'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of <root>.<get-kt26531Val> origin=INVOKE
$this: CALL 'public final fun <get-kt26531Val> <T> (): kotlin.Function0<T of <root>.<get-kt26531Val>> declared in <root>' type=kotlin.Function0<kotlin.Int> origin=null
<T>: kotlin.Int
$receiver: CONST Int type=kotlin.Int value=7