FIR2IR: read extension function type attribute properly

This commit is contained in:
Mikhail Glukhikh
2021-11-09 09:08:17 +03:00
committed by teamcityserver
parent b2d020606e
commit d6bc6bec59
21 changed files with 46 additions and 179 deletions
@@ -1,15 +0,0 @@
FILE fqName:<root> fileName:/extensionLambda.kt
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Int declared in <root>'
CALL 'public final fun run <T, R> (block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.run, R of kotlin.StandardKt.run>): R of kotlin.StandardKt.run [inline] declared in kotlin.StandardKt' type=kotlin.Int origin=null
<T>: kotlin.String
<R>: kotlin.Int
$receiver: CONST String type=kotlin.String value="42"
block: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:$this$run type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.test1'
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '$this$run: kotlin.String declared in <root>.test1.<anonymous>' type=kotlin.String origin=null
@@ -1,7 +0,0 @@
fun test1(): Int {
return "42".run<String, Int>(block = local fun String.<anonymous>(): Int {
return $this$run.<get-length>()
}
)
}
@@ -1 +1,2 @@
// FIR_IDENTICAL
fun test1() = "42".run { length }
@@ -90,7 +90,7 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
<T>: <root>.A
<R>: kotlin.Int
receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.A
block: FUN_EXPR type=kotlin.Function1<<root>.A, kotlin.Int> origin=LAMBDA
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.A, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.A) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:$this$with type:<root>.A
BLOCK_BODY
@@ -99,7 +99,7 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
<T>: <root>.IFoo
<R>: kotlin.Int
receiver: GET_VAR 'fooImpl: <root>.IFoo declared in <root>.test' type=<root>.IFoo origin=null
block: FUN_EXPR type=kotlin.Function1<<root>.IFoo, kotlin.Int> origin=LAMBDA
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.IFoo, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.IFoo) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:$this$with type:<root>.IFoo
BLOCK_BODY
@@ -108,7 +108,7 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
<T>: <root>.IInvoke
<R>: kotlin.Int
receiver: GET_VAR 'invokeImpl: <root>.IInvoke declared in <root>.test' type=<root>.IInvoke origin=null
block: FUN_EXPR type=kotlin.Function1<<root>.IInvoke, kotlin.Int> origin=LAMBDA
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.IInvoke, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.IInvoke) returnType:kotlin.Int
$receiver: VALUE_PARAMETER name:$this$with type:<root>.IInvoke
BLOCK_BODY