Support default arguments and varargs for callable references
#KT-8834 #KT-19869 #KT-25514
This commit is contained in:
+63
@@ -2245,6 +2245,69 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/callableReference/serializability/withReflect.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/callableReference/varargAndDefaults")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class VarargAndDefaults extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInVarargAndDefaults() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/callableReference/varargAndDefaults"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boundReferences.kt")
|
||||
public void testBoundReferences() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/boundReferences.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultAfterVararg.kt")
|
||||
public void testDefaultAfterVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/defaultAfterVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultWithGenericExpectedType.kt")
|
||||
public void testDefaultWithGenericExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/defaultWithGenericExpectedType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("emptyVarargAndDefault.kt")
|
||||
public void testEmptyVarargAndDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/emptyVarargAndDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inline.kt")
|
||||
public void testInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/inline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("manyDefaultsAndVararg.kt")
|
||||
public void testManyDefaultsAndVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/manyDefaultsAndVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleDefaultArgument.kt")
|
||||
public void testSimpleDefaultArgument() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/simpleDefaultArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleEmptyVararg.kt")
|
||||
public void testSimpleEmptyVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/simpleEmptyVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargViewedAsArray.kt")
|
||||
public void testVarargViewedAsArray() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/varargViewedAsArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargWithDefaultValue.kt")
|
||||
public void testVarargWithDefaultValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/varargWithDefaultValue.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/casts")
|
||||
|
||||
+63
@@ -2265,6 +2265,69 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/callableReference/serializability/withReflect.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/callableReference/varargAndDefaults")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class VarargAndDefaults extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInVarargAndDefaults() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/callableReference/varargAndDefaults"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boundReferences.kt")
|
||||
public void testBoundReferences() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/boundReferences.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultAfterVararg.kt")
|
||||
public void testDefaultAfterVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/defaultAfterVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultWithGenericExpectedType.kt")
|
||||
public void testDefaultWithGenericExpectedType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/defaultWithGenericExpectedType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("emptyVarargAndDefault.kt")
|
||||
public void testEmptyVarargAndDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/emptyVarargAndDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inline.kt")
|
||||
public void testInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/inline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("manyDefaultsAndVararg.kt")
|
||||
public void testManyDefaultsAndVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/manyDefaultsAndVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleDefaultArgument.kt")
|
||||
public void testSimpleDefaultArgument() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/simpleDefaultArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleEmptyVararg.kt")
|
||||
public void testSimpleEmptyVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/simpleEmptyVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargViewedAsArray.kt")
|
||||
public void testVarargViewedAsArray() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/varargViewedAsArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargWithDefaultValue.kt")
|
||||
public void testVarargWithDefaultValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/varargAndDefaults/varargWithDefaultValue.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/casts")
|
||||
|
||||
Reference in New Issue
Block a user