Add test to check work of inline classes with callable references
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// !LANGUAGE: +InlineClasses
|
||||||
|
// WITH_REFLECT
|
||||||
|
|
||||||
|
inline class Foo(val x: String) {
|
||||||
|
fun bar(f: Foo, i: Int): Foo = Foo(x + f.x + i)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val f = Foo("original")
|
||||||
|
val function1 = f::bar
|
||||||
|
val result1 = function1.invoke(Foo("+argument+"), 42)
|
||||||
|
if (result1.x != "original+argument+42") return "Fail first"
|
||||||
|
|
||||||
|
val result2 = Foo::bar.invoke(Foo("explicit"), Foo("+argument2+"), 10)
|
||||||
|
if (result2.x != "explicit+argument2+10") return "Fail second"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
Generated
+5
@@ -11174,6 +11174,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReferencesWithInlineClasses.kt")
|
||||||
|
public void testCallableReferencesWithInlineClasses() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
||||||
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
||||||
|
|||||||
+5
@@ -11174,6 +11174,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReferencesWithInlineClasses.kt")
|
||||||
|
public void testCallableReferencesWithInlineClasses() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
||||||
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
||||||
|
|||||||
+5
@@ -11174,6 +11174,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReferencesWithInlineClasses.kt")
|
||||||
|
public void testCallableReferencesWithInlineClasses() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
||||||
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
||||||
|
|||||||
+5
@@ -9710,6 +9710,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("callableReferencesWithInlineClasses.kt")
|
||||||
|
public void testCallableReferencesWithInlineClasses() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/callableReferencesWithInlineClasses.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
@TestMetadata("checkBoxUnboxOfArgumentsOnInlinedFunctions.kt")
|
||||||
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
public void testCheckBoxUnboxOfArgumentsOnInlinedFunctions() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/checkBoxUnboxOfArgumentsOnInlinedFunctions.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user