IrFunctionExpression: update fir2ir tests

This commit is contained in:
Dmitry Petrov
2019-07-15 12:35:30 +03:00
parent ed2b4a8bec
commit 41b59f9b9a
24 changed files with 48 additions and 106 deletions
@@ -16,12 +16,11 @@ FILE fqName:<root> fileName:/badBreakContinue.kt
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
VAR name:lambda type:kotlin.Function0<kotlin.Nothing> [val]
BLOCK type=kotlin.Function0<kotlin.Nothing> origin=LAMBDA
FUN_EXPR type=kotlin.Function0<kotlin.Nothing>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Nothing
BLOCK_BODY
BREAK label=L1 loop.label=L1
CONTINUE label=L1 loop.label=L1
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Nothing declared in <root>.test3' type=kotlin.Function0<kotlin.Nothing> origin=LAMBDA
FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
WHILE label=null origin=WHILE_LOOP
@@ -30,4 +29,3 @@ FILE fqName:<root> fileName:/badBreakContinue.kt
WHILE label=null origin=WHILE_LOOP
condition: ERROR_EXPR 'Unbound loop: continue@@@[ERROR_EXPR(Cannot bind unlabeled jump to a loop)] ' type=kotlin.Nothing
body: BLOCK type=kotlin.Unit origin=null
@@ -2,11 +2,10 @@ FILE fqName:<root> fileName:/coercionToUnit.kt
PROPERTY name:test1 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0<kotlin.Unit> visibility:public [final,static]
EXPRESSION_BODY
BLOCK type=kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Function0<kotlin.Unit>> origin=LAMBDA
FUN_EXPR type=kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Function0<kotlin.Unit>>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
CONST Int type=kotlin.Function0<kotlin.Unit> value=42
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Function0<kotlin.Unit> declared in <root>.test1' type=kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Function0<kotlin.Unit>> origin=LAMBDA
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Function0<kotlin.Unit>
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
BLOCK_BODY
@@ -26,4 +25,3 @@ FILE fqName:<root> fileName:/coercionToUnit.kt
CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static] ' type=java.io.PrintStream? origin=GET_PROPERTY
x: CONST String type=kotlin.String value="world!"
@@ -26,12 +26,11 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
PROPERTY name:value visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0<kotlin.String> visibility:public [final]
EXPRESSION_BODY
BLOCK type=kotlin.Function0<kotlin.String> origin=LAMBDA
FUN_EXPR type=kotlin.Function0<kotlin.String>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.X.B) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.X.B
BLOCK_BODY
CALL 'public final fun <get-value2> (): kotlin.String declared in <root>.X.B' type=kotlin.String origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.String declared in <root>.X.B.value' type=kotlin.Function0<kotlin.String> origin=LAMBDA
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-value> visibility:public modality:FINAL <> ($this:<root>.X.B) returnType:kotlin.Function0<kotlin.String>
correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.X.B
@@ -43,14 +43,13 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
PROPERTY name:aLambda visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:public [final]
EXPRESSION_BODY
BLOCK type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN_EXPR type=kotlin.Function0<kotlin.Unit>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Unit declared in <root>.MyEnum.Z.aLambda' type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aLambda> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Function0<kotlin.Unit>
correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
@@ -122,4 +121,3 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum
@@ -15,13 +15,12 @@ FILE fqName:<root> fileName:/genericConstructorCallWithTypeArguments.kt
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, T of kotlin.Array>) declared in kotlin.Array' type=kotlin.Array<T of <root>.testArray> origin=null
<class: T>: <none>
size: GET_VAR 'n: kotlin.Int declared in <root>.testArray' type=kotlin.Int origin=null
init: BLOCK type=kotlin.Function1<kotlin.Int, T of kotlin.Array> origin=LAMBDA
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, T of kotlin.Array>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:T of kotlin.Array
VALUE_PARAMETER name:it index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public abstract fun invoke (): T of <root>.testArray declared in kotlin.Function0' type=T of <root>.testArray origin=null
$this: GET_VAR 'block: kotlin.Function0<T of <root>.testArray> [crossinline] declared in <root>.testArray' type=kotlin.Function0<T of <root>.testArray> origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (it: kotlin.Int): T of kotlin.Array declared in <root>.testArray' type=kotlin.Function1<kotlin.Int, T of kotlin.Array> origin=LAMBDA
CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Box
TYPE_PARAMETER name:T index:0 variance: superTypes:[]
@@ -24,18 +24,15 @@ FILE fqName:<root> fileName:/lambdaInCAO.kt
BLOCK_BODY
VAR name:<unary> type:kotlin.Int [val]
CALL 'public final fun get (index: kotlin.Function0<kotlin.Unit>): kotlin.Int declared in <root>' type=kotlin.Int origin=null
index: BLOCK type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
index: FUN_EXPR type=kotlin.Function0<kotlin.Unit>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Unit declared in <root>.test3' type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
CALL 'public final fun set (index: kotlin.Function0<kotlin.Unit>, value: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
index: BLOCK type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
index: FUN_EXPR type=kotlin.Function0<kotlin.Unit>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Unit declared in <root>.test3' type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val <unary>: kotlin.Int [val] declared in <root>.test3' type=kotlin.Int origin=null
GET_VAR 'val <unary>: kotlin.Int [val] declared in <root>.test3' type=kotlin.Int origin=null
@@ -78,7 +78,7 @@ FILE fqName:<root> fileName:/objectReference.kt
PROPERTY name:aLambda visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:public [final]
EXPRESSION_BODY
BLOCK type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN_EXPR type=kotlin.Function0<kotlin.Unit>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
@@ -89,7 +89,6 @@ FILE fqName:<root> fileName:/objectReference.kt
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Unit declared in <root>.Z.aLambda' type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aLambda> visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Function0<kotlin.Unit>
correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Z
@@ -35,11 +35,10 @@ FILE fqName:<root> fileName:/objectReferenceInClosureInSuperConstructorCall.kt
CONSTRUCTOR visibility:private <> () returnType:<root>.Test [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (lambda: kotlin.Function0<kotlin.Any>) [primary] declared in <root>.Base'
lambda: BLOCK type=IrErrorType origin=LAMBDA
lambda: FUN_EXPR type=IrErrorType
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:IrErrorType
BLOCK_BODY
ERROR_CALL 'Unresolved reference: Test#' type=IrErrorType
FUNCTION_REFERENCE 'local final fun <anonymous> (): IrErrorType declared in <root>.Test.<init>' type=IrErrorType origin=LAMBDA
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[<root>.Base]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
@@ -54,4 +53,3 @@ FILE fqName:<root> fileName:/objectReferenceInClosureInSuperConstructorCall.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -3,11 +3,10 @@ FILE fqName:<root> fileName:/samConstructors.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Unresolved name: Runnable>#' type=IrErrorType
BLOCK type=IrErrorType origin=LAMBDA
FUN_EXPR type=IrErrorType
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:IrErrorType
BLOCK_BODY
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
FUNCTION_REFERENCE 'local final fun <anonymous> (): IrErrorType declared in <root>.test1' type=IrErrorType origin=LAMBDA
FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0<kotlin.Unit>) returnType:IrErrorType
VALUE_PARAMETER name:a index:0 type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
@@ -25,12 +24,10 @@ FILE fqName:<root> fileName:/samConstructors.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Unresolved name: Comparator>#' type=IrErrorType
BLOCK type=IrErrorType origin=LAMBDA
FUN_EXPR type=IrErrorType
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (a:IrErrorType, b:IrErrorType) returnType:IrErrorType
VALUE_PARAMETER name:a index:0 type:IrErrorType
VALUE_PARAMETER name:b index:1 type:IrErrorType
BLOCK_BODY
ERROR_CALL 'Unresolved reference: minus#' type=IrErrorType
ERROR_CALL 'Unresolved reference: b#' type=IrErrorType
FUNCTION_REFERENCE 'local final fun <anonymous> (a: IrErrorType, b: IrErrorType): IrErrorType declared in <root>.test4' type=IrErrorType origin=LAMBDA
@@ -9,19 +9,17 @@ FILE fqName:<root> fileName:/samConversions.kt
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
r: BLOCK type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
r: FUN_EXPR type=kotlin.Function0<kotlin.Unit>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun test1 (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Unit declared in <root>.test1' type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
r: BLOCK type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
r: FUN_EXPR type=kotlin.Function0<kotlin.Unit>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun test1 (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Unit declared in <root>.test2' type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
@@ -41,4 +39,3 @@ FILE fqName:<root> fileName:/samConversions.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'b: kotlin.Function0<kotlin.Unit> declared in <root>.test4' type=kotlin.Function0<kotlin.Unit> origin=null
@@ -2,11 +2,10 @@ FILE fqName:<root> fileName:/variableAsFunctionCall.kt
FUN name:k visibility:public modality:FINAL <> () returnType:kotlin.Function0<kotlin.String>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun k (): kotlin.Function0<kotlin.String> declared in <root>'
BLOCK type=kotlin.Function1<kotlin.Function0<kotlin.String>, kotlin.Function0<kotlin.String>> origin=LAMBDA
FUN_EXPR type=kotlin.Function1<kotlin.Function0<kotlin.String>, kotlin.Function0<kotlin.String>>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Function0<kotlin.String>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: this#' type=kotlin.String
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Function0<kotlin.String> declared in <root>.k' type=kotlin.Function1<kotlin.Function0<kotlin.String>, kotlin.Function0<kotlin.String>> origin=LAMBDA
FUN name:test1 visibility:public modality:FINAL <> (f:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit
VALUE_PARAMETER name:f index:0 type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
@@ -4,11 +4,10 @@ FILE fqName:<root> fileName:/variableAsFunctionCallWithGenerics.kt
correspondingProperty: PROPERTY name:gk visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-gk> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>'
BLOCK type=kotlin.Function1<kotlin.Function0<T of <uninitialized parent>>, kotlin.Function0<T of <uninitialized parent>>> origin=LAMBDA
FUN_EXPR type=kotlin.Function1<kotlin.Function0<T of <uninitialized parent>>, kotlin.Function0<T of <uninitialized parent>>>
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Function0<T of <uninitialized parent>>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: this#' type=IrErrorType
FUNCTION_REFERENCE 'local final fun <anonymous> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>.<get-gk>' type=kotlin.Function1<kotlin.Function0<T of <uninitialized parent>>, kotlin.Function0<T of <uninitialized parent>>> origin=LAMBDA
FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:T of <uninitialized parent>
VALUE_PARAMETER name:x index:0 type:kotlin.String
BLOCK_BODY
@@ -20,12 +19,11 @@ FILE fqName:<root> fileName:/variableAsFunctionCallWithGenerics.kt
correspondingProperty: PROPERTY name:kt26531Val visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-kt26531Val> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>'
BLOCK type=kotlin.Function0<kotlin.Function0<T of <uninitialized parent>>> origin=ANONYMOUS_FUNCTION
FUN_EXPR type=kotlin.Function0<kotlin.Function0<T of <uninitialized parent>>>
FUN name:<no name provided> visibility:local modality:FINAL <> () returnType:kotlin.Function0<T of <uninitialized parent>>
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <no name provided> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>.<get-kt26531Val>'
ERROR_CALL 'Unresolved reference: this#' type=IrErrorType
FUNCTION_REFERENCE 'local final fun <no name provided> (): kotlin.Function0<T of <uninitialized parent>> declared in <root>.<get-kt26531Val>' type=kotlin.Function0<kotlin.Function0<T of <uninitialized parent>>> origin=ANONYMOUS_FUNCTION
FUN name:kt26531 visibility:public modality:FINAL <> () returnType:T of <uninitialized parent>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun kt26531 (): T of <uninitialized parent> declared in <root>'