[FIR] FIR2IR: Populate calls with type arguments and function type

parameters with bounds/supertypes.
This commit is contained in:
Mark Punzalan
2019-11-23 23:37:35 -08:00
committed by Mikhail Glukhikh
parent 58dd9a6004
commit 5afab1ac2b
125 changed files with 379 additions and 341 deletions
@@ -2,7 +2,9 @@ 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 (block: kotlin.Function1<T of <uninitialized parent>, R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun run <T, R> (block: kotlin.Function1<T of kotlin.run, R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' 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 <> () returnType:kotlin.Int
@@ -84,17 +84,23 @@ FILE fqName:<root> fileName:/multipleImplicitReceivers.kt
VALUE_PARAMETER name:fooImpl index:0 type:<root>.IFoo
VALUE_PARAMETER name:invokeImpl index:1 type:<root>.IInvoke
BLOCK_BODY
CALL 'public final fun with (receiver: T of <uninitialized parent>, block: kotlin.Function1<T of <uninitialized parent>, R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
<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.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun with (receiver: T of <uninitialized parent>, block: kotlin.Function1<T of <uninitialized parent>, R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
<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.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun with (receiver: T of <uninitialized parent>, block: kotlin.Function1<T of <uninitialized parent>, R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null
<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.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
+14 -7
View File
@@ -1,7 +1,8 @@
FILE fqName:<root> fileName:/nonLocalReturn.kt
FUN name:test0 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun run (block: kotlin.Function0<R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Unit origin=null
CALL 'public final fun run <R> (block: kotlin.Function0<R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null
<R>: kotlin.Unit
block: FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
@@ -9,7 +10,8 @@ FILE fqName:<root> fileName:/nonLocalReturn.kt
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun run (block: kotlin.Function0<R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Unit origin=null
CALL 'public final fun run <R> (block: kotlin.Function0<R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null
<R>: kotlin.Unit
block: FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
@@ -17,7 +19,8 @@ FILE fqName:<root> fileName:/nonLocalReturn.kt
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun run (block: kotlin.Function0<R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Unit origin=null
CALL 'public final fun run <R> (block: kotlin.Function0<R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null
<R>: kotlin.Unit
block: FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
@@ -25,11 +28,13 @@ FILE fqName:<root> fileName:/nonLocalReturn.kt
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun run (block: kotlin.Function0<R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Unit origin=null
CALL 'public final fun run <R> (block: kotlin.Function0<R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null
<R>: kotlin.Unit
block: FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun run (block: kotlin.Function0<R of <uninitialized parent>>): R of <uninitialized parent> [inline] declared in kotlin' type=kotlin.Unit origin=null
CALL 'public final fun run <R> (block: kotlin.Function0<R of kotlin.run>): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null
<R>: kotlin.Unit
block: FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
@@ -38,7 +43,8 @@ FILE fqName:<root> fileName:/nonLocalReturn.kt
FUN name:testLrmFoo1 visibility:public modality:FINAL <> (ints:kotlin.collections.List<kotlin.Int>) returnType:kotlin.Unit
VALUE_PARAMETER name:ints index:0 type:kotlin.collections.List<kotlin.Int>
BLOCK_BODY
CALL 'public final fun forEach (action: kotlin.Function1<T of <uninitialized parent>, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
CALL 'public final fun forEach <T> (action: kotlin.Function1<T of kotlin.collections.forEach, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
<T>: kotlin.Int
$receiver: GET_VAR 'ints: kotlin.collections.List<kotlin.Int> declared in <root>.testLrmFoo1' type=kotlin.collections.List<kotlin.Int> origin=null
action: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit
@@ -56,7 +62,8 @@ FILE fqName:<root> fileName:/nonLocalReturn.kt
FUN name:testLrmFoo2 visibility:public modality:FINAL <> (ints:kotlin.collections.List<kotlin.Int>) returnType:kotlin.Unit
VALUE_PARAMETER name:ints index:0 type:kotlin.collections.List<kotlin.Int>
BLOCK_BODY
CALL 'public final fun forEach (action: kotlin.Function1<T of <uninitialized parent>, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
CALL 'public final fun forEach <T> (action: kotlin.Function1<T of kotlin.collections.forEach, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null
<T>: kotlin.Int
$receiver: GET_VAR 'ints: kotlin.collections.List<kotlin.Int> declared in <root>.testLrmFoo2' type=kotlin.collections.List<kotlin.Int> origin=null
action: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit