PSI2IR test for coercion to unit in lambda
This commit is contained in:
+5
@@ -1827,6 +1827,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
|||||||
runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt");
|
runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("coercionToUnitInLambdaReturnValue.kt")
|
||||||
|
public void testCoercionToUnitInLambdaReturnValue() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericPropertyReferenceType.kt")
|
@TestMetadata("genericPropertyReferenceType.kt")
|
||||||
public void testGenericPropertyReferenceType() throws Exception {
|
public void testGenericPropertyReferenceType() throws Exception {
|
||||||
runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt");
|
runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt");
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
FILE fqName:<root> fileName:/coercionToUnitInLambdaReturnValue.kt
|
||||||
|
FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:fn index:0 type:kotlin.Function0<kotlin.Unit>
|
||||||
|
BLOCK_BODY
|
||||||
|
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun use (fn: kotlin.Function0<kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
|
fn: 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
|
||||||
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.test'
|
||||||
|
CONST Int type=kotlin.Int value=42
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
// !LANGUAGE: +NewInference
|
||||||
|
|
||||||
|
fun use(fn: () -> Unit) {}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
use { 42 }
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
FILE fqName:<root> fileName:/coercionToUnitInLambdaReturnValue.kt
|
||||||
|
FUN name:use visibility:public modality:FINAL <> (fn:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:fn index:0 type:kotlin.Function0<kotlin.Unit>
|
||||||
|
BLOCK_BODY
|
||||||
|
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
CALL 'public final fun use (fn: kotlin.Function0<kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||||
|
fn: 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
|
||||||
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
|
CONST Int type=kotlin.Int value=42
|
||||||
@@ -1826,6 +1826,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
|||||||
runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt");
|
runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("coercionToUnitInLambdaReturnValue.kt")
|
||||||
|
public void testCoercionToUnitInLambdaReturnValue() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericPropertyReferenceType.kt")
|
@TestMetadata("genericPropertyReferenceType.kt")
|
||||||
public void testGenericPropertyReferenceType() throws Exception {
|
public void testGenericPropertyReferenceType() throws Exception {
|
||||||
runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt");
|
runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user