FIR2IR: add extension receiver parameters to functions

This commit is contained in:
Mikhail Glukhikh
2019-07-17 15:21:34 +03:00
parent be3fe9495c
commit 63b7fa70f9
63 changed files with 393 additions and 158 deletions
@@ -21,8 +21,9 @@ FILE fqName:<root> fileName:/receiverParameterWithAnnotations.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:f visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.String
FUN name:f visibility:public modality:FINAL <> ($this:<root>.A, $receiver:kotlin.String) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in <root>.A'
CONST String type=kotlin.String value=""
@@ -46,7 +47,8 @@ FILE fqName:<root> fileName:/receiverParameterWithAnnotations.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:topLevelF visibility:public modality:FINAL <> () returnType:kotlin.String
FUN name:topLevelF visibility:public modality:FINAL <> ($receiver:kotlin.String?) returnType:kotlin.String
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String?
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun topLevelF (): kotlin.String declared in <root>'
CONST String type=kotlin.String value=""
@@ -15,7 +15,8 @@ FILE fqName:<root> fileName:/fun.kt
FUN name:test3 visibility:public modality:FINAL <> (args:kotlin.Array<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String>
BLOCK_BODY
FUN name:textExt1 visibility:public modality:FINAL <> (i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit
FUN name:textExt1 visibility:public modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:i index:0 type:kotlin.Int
VALUE_PARAMETER name:j index:1 type:kotlin.String
BLOCK_BODY
@@ -25,15 +26,17 @@ FILE fqName:<root> fileName:/fun.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:testMembetExt1 visibility:public modality:FINAL <> ($this:<root>.Host, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit
FUN name:testMembetExt1 visibility:public modality:FINAL <> ($this:<root>.Host, $receiver:kotlin.String, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:i index:0 type:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:i index:0 type:kotlin.Int
VALUE_PARAMETER name:j index:1 type:kotlin.String
BLOCK_BODY
FUN name:testMembetExt2 visibility:public modality:FINAL <T> ($this:<root>.Host, i:kotlin.Int, j:T of <root>.Host.testMembetExt2) returnType:kotlin.Unit
FUN name:testMembetExt2 visibility:public modality:FINAL <T> ($this:<root>.Host, $receiver:kotlin.String, i:kotlin.Int, j:T of <root>.Host.testMembetExt2) returnType:kotlin.Unit
TYPE_PARAMETER name:T index:0 variance: superTypes:[]
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:i index:0 type:kotlin.Int
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:i index:0 type:kotlin.Int
VALUE_PARAMETER name:j index:1 type:T of <root>.Host.testMembetExt2
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
@@ -18,7 +18,8 @@ FILE fqName:<root> fileName:/localFun.kt
FUN name:test3 visibility:local modality:FINAL <> (args:kotlin.Array<kotlin.String>) returnType:kotlin.Unit
VALUE_PARAMETER name:args index:0 type:kotlin.Array<kotlin.String>
BLOCK_BODY
FUN name:textExt1 visibility:local modality:FINAL <> (i:kotlin.Int, j:TT of <root>.outer) returnType:kotlin.Unit
FUN name:textExt1 visibility:local modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:TT of <root>.outer) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:i index:0 type:kotlin.Int
VALUE_PARAMETER name:j index:1 type:TT of <root>.outer
BLOCK_BODY
@@ -30,14 +30,16 @@ FILE fqName:<root> fileName:/differentReceivers.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:provideDelegate visibility:public modality:FINAL <> (host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
FUN name:provideDelegate visibility:public modality:FINAL <> ($receiver:<root>.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyClass
VALUE_PARAMETER name:host index:0 type:kotlin.Any?
VALUE_PARAMETER name:p index:1 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in <root>'
CALL 'public final fun <get-value> (): kotlin.String declared in <root>.MyClass' type=kotlin.String origin=null
$this: ERROR_CALL 'Unresolved reference: this#' type=<root>.MyClass
FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
FUN name:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:receiver index:0 type:kotlin.Any?
VALUE_PARAMETER name:p index:1 type:kotlin.Any
BLOCK_BODY
@@ -30,14 +30,16 @@ FILE fqName:<root> fileName:/localDifferentReceivers.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:provideDelegate visibility:public modality:FINAL <> (host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
FUN name:provideDelegate visibility:public modality:FINAL <> ($receiver:<root>.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyClass
VALUE_PARAMETER name:host index:0 type:kotlin.Any?
VALUE_PARAMETER name:p index:1 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in <root>'
CALL 'public final fun <get-value> (): kotlin.String declared in <root>.MyClass' type=kotlin.String origin=null
$this: ERROR_CALL 'Unresolved reference: this#' type=<root>.MyClass
FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
FUN name:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:receiver index:0 type:kotlin.Any?
VALUE_PARAMETER name:p index:1 type:kotlin.Any
BLOCK_BODY
@@ -45,9 +45,10 @@ FILE fqName:<root> fileName:/memberExtension.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:provideDelegate visibility:public modality:FINAL <> ($this:<root>.Host, host:kotlin.Any?, p:kotlin.Any) returnType:<root>.Host.StringDelegate
FUN name:provideDelegate visibility:public modality:FINAL <> ($this:<root>.Host, $receiver:kotlin.String, host:kotlin.Any?, p:kotlin.Any) returnType:<root>.Host.StringDelegate
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:host index:0 type:kotlin.Any?
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
VALUE_PARAMETER name:host index:0 type:kotlin.Any?
VALUE_PARAMETER name:p index:1 type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): <root>.Host.StringDelegate declared in <root>.Host'