[FE] Resolve overload conflict between contextual and non-contextual declarations
This commit is contained in:
committed by
TeamCityServer
parent
7fd5034cd6
commit
f427265739
+32
-6
@@ -10567,128 +10567,154 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/variableInvoke.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/variableInvoke.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/testData/diagnostics/tests/extensions/contextReceivers")
|
@TestMetadata("compiler/testData/diagnostics/tests/extensions/contextReceivers")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class ContextReceivers {
|
||||||
public static class ContextReceivers extends AbstractDiagnosisCompilerTestDataTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInContextReceivers() throws Exception {
|
public void testAllFilesPresentInContextReceivers() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/extensions/contextReceivers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/extensions/contextReceivers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("ambiguityInGroup.kt")
|
@TestMetadata("ambiguityInGroup.kt")
|
||||||
public void testAmbiguityInGroup() throws Exception {
|
public void testAmbiguityInGroup() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/ambiguityInGroup.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/ambiguityInGroup.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("dp.kt")
|
@TestMetadata("dp.kt")
|
||||||
public void testDp() throws Exception {
|
public void testDp() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/dp.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/dp.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("genericOuterClass.kt")
|
@TestMetadata("genericOuterClass.kt")
|
||||||
public void testGenericOuterClass() throws Exception {
|
public void testGenericOuterClass() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/genericOuterClass.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/genericOuterClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("insideDeclaration.kt")
|
@TestMetadata("insideDeclaration.kt")
|
||||||
public void testInsideDeclaration() throws Exception {
|
public void testInsideDeclaration() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/insideDeclaration.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/insideDeclaration.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lazy.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lazy.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("localDeclaration.kt")
|
@TestMetadata("localDeclaration.kt")
|
||||||
public void testLocalDeclaration() throws Exception {
|
public void testLocalDeclaration() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/localDeclaration.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/localDeclaration.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("manyReceivers.kt")
|
@TestMetadata("manyReceivers.kt")
|
||||||
public void testManyReceivers() throws Exception {
|
public void testManyReceivers() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/manyReceivers.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/manyReceivers.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("noBackingField.kt")
|
@TestMetadata("noBackingField.kt")
|
||||||
public void testNoBackingField() throws Exception {
|
public void testNoBackingField() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noBackingField.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noBackingField.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("noContextReceiversOnInlineClasses.kt")
|
@TestMetadata("noContextReceiversOnInlineClasses.kt")
|
||||||
public void testNoContextReceiversOnInlineClasses() throws Exception {
|
public void testNoContextReceiversOnInlineClasses() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noContextReceiversOnInlineClasses.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noContextReceiversOnInlineClasses.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("noExplicitReceiver.kt")
|
@TestMetadata("noExplicitReceiver.kt")
|
||||||
public void testNoExplicitReceiver() throws Exception {
|
public void testNoExplicitReceiver() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noExplicitReceiver.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noExplicitReceiver.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("outerClass.kt")
|
@TestMetadata("outerClass.kt")
|
||||||
public void testOuterClass() throws Exception {
|
public void testOuterClass() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadPriority.kt")
|
||||||
|
public void testOverloadPriority() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/overloadPriority.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("plusMatrix.kt")
|
@TestMetadata("plusMatrix.kt")
|
||||||
public void testPlusMatrix() throws Exception {
|
public void testPlusMatrix() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/plusMatrix.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/plusMatrix.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("superWithContext.kt")
|
@TestMetadata("superWithContext.kt")
|
||||||
public void testSuperWithContext() throws Exception {
|
public void testSuperWithContext() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/superWithContext.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/superWithContext.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("syntaxError.kt")
|
@TestMetadata("syntaxError.kt")
|
||||||
public void testSyntaxError() throws Exception {
|
public void testSyntaxError() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/syntaxError.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/syntaxError.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("thisIdentifierInfo.kt")
|
@TestMetadata("thisIdentifierInfo.kt")
|
||||||
public void testThisIdentifierInfo() throws Exception {
|
public void testThisIdentifierInfo() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisIdentifierInfo.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisIdentifierInfo.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("thisWithCustomLabel.kt")
|
@TestMetadata("thisWithCustomLabel.kt")
|
||||||
public void testThisWithCustomLabel() throws Exception {
|
public void testThisWithCustomLabel() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithCustomLabel.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithCustomLabel.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("thisWithReceiverLabelsClasses.kt")
|
@TestMetadata("thisWithReceiverLabelsClasses.kt")
|
||||||
public void testThisWithReceiverLabelsClasses() throws Exception {
|
public void testThisWithReceiverLabelsClasses() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsClasses.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsClasses.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("thisWithReceiverLabelsFunctions.kt")
|
@TestMetadata("thisWithReceiverLabelsFunctions.kt")
|
||||||
public void testThisWithReceiverLabelsFunctions() throws Exception {
|
public void testThisWithReceiverLabelsFunctions() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsFunctions.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsFunctions.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("thisWithReceiverLabelsProperties.kt")
|
@TestMetadata("thisWithReceiverLabelsProperties.kt")
|
||||||
public void testThisWithReceiverLabelsProperties() throws Exception {
|
public void testThisWithReceiverLabelsProperties() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsProperties.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsProperties.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("typeParameterized.kt")
|
@TestMetadata("typeParameterized.kt")
|
||||||
public void testTypeParameterized() throws Exception {
|
public void testTypeParameterized() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterized.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterized.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("typeParameterizedList.kt")
|
@TestMetadata("typeParameterizedList.kt")
|
||||||
public void testTypeParameterizedList() throws Exception {
|
public void testTypeParameterizedList() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterizedList.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterizedList.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("withExplicitReceiver.kt")
|
@TestMetadata("withExplicitReceiver.kt")
|
||||||
public void testWithExplicitReceiver() throws Exception {
|
public void testWithExplicitReceiver() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiver.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiver.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
@TestMetadata("withExplicitReceiverError.kt")
|
@TestMetadata("withExplicitReceiverError.kt")
|
||||||
public void testWithExplicitReceiverError() throws Exception {
|
public void testWithExplicitReceiverError() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiverError.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiverError.kt");
|
||||||
|
|||||||
+157
-114
@@ -33,64 +33,49 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/annotations")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/annotations")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Annotations {
|
||||||
public static class Annotations extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInAnnotations() throws Exception {
|
public void testAllFilesPresentInAnnotations() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Annotation_targets {
|
||||||
public static class Annotation_targets extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInAnnotation_targets() throws Exception {
|
public void testAllFilesPresentInAnnotation_targets() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Built_in_types_and_their_semantics {
|
||||||
public static class Built_in_types_and_their_semantics extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInBuilt_in_types_and_their_semantics() throws Exception {
|
public void testAllFilesPresentInBuilt_in_types_and_their_semantics() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Built_in_integer_types_1 {
|
||||||
public static class Built_in_integer_types_1 extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInBuilt_in_integer_types_1() throws Exception {
|
public void testAllFilesPresentInBuilt_in_integer_types_1() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1/integer-type-widening")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1/integer-type-widening")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Integer_type_widening {
|
||||||
public static class Integer_type_widening extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInInteger_type_widening() throws Exception {
|
public void testAllFilesPresentInInteger_type_widening() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1/integer-type-widening"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1/integer-type-widening"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -215,26 +200,20 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Performing_analysis_on_the_control_flow_graph {
|
||||||
public static class Performing_analysis_on_the_control_flow_graph extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInPerforming_analysis_on_the_control_flow_graph() throws Exception {
|
public void testAllFilesPresentInPerforming_analysis_on_the_control_flow_graph() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Variable_initialization_analysis {
|
||||||
public static class Variable_initialization_analysis extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInVariable_initialization_analysis() throws Exception {
|
public void testAllFilesPresentInVariable_initialization_analysis() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -242,14 +221,11 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Control__and_data_flow_analysis_control_flow_graph_expressions_1_conditional_expressions {
|
||||||
public static class Control__and_data_flow_analysis_control_flow_graph_expressions_1_conditional_expressions extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInControl__and_data_flow_analysis_control_flow_graph_expressions_1_conditional_expressions() throws Exception {
|
public void testAllFilesPresentInControl__and_data_flow_analysis_control_flow_graph_expressions_1_conditional_expressions() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -622,55 +598,43 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Nested_and_inner_classifiers {
|
||||||
public static class Nested_and_inner_classifiers extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInNested_and_inner_classifiers() throws Exception {
|
public void testAllFilesPresentInNested_and_inner_classifiers() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Classifier_initialization {
|
||||||
public static class Classifier_initialization extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInClassifier_initialization() throws Exception {
|
public void testAllFilesPresentInClassifier_initialization() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/data-class-declaration")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/data-class-declaration")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Data_class_declaration {
|
||||||
public static class Data_class_declaration extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInData_class_declaration() throws Exception {
|
public void testAllFilesPresentInData_class_declaration() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/data-class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/data-class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Function_declaration {
|
||||||
public static class Function_declaration extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInFunction_declaration() throws Exception {
|
public void testAllFilesPresentInFunction_declaration() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -721,28 +685,22 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/property-initialization")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/property-initialization")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Property_initialization {
|
||||||
public static class Property_initialization extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInProperty_initialization() throws Exception {
|
public void testAllFilesPresentInProperty_initialization() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/property-initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/property-initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Type_alias {
|
||||||
public static class Type_alias extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInType_alias() throws Exception {
|
public void testAllFilesPresentInType_alias() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -876,6 +834,36 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Call_and_property_access_expressions {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInCall_and_property_access_expressions() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/callable-references")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Callable_references {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInCallable_references() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/callable-references"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/navigation-operators")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Navigation_operators {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNavigation_operators() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/call-and-property-access-expressions/navigation-operators"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@@ -1946,6 +1934,26 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Function_literals {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInFunction_literals() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals/lambda-literals")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Lambda_literals {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInLambda_literals() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/function-literals/lambda-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@@ -3355,6 +3363,26 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/inheritance")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Inheritance {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInInheritance() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/inheritance"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/inheritance/overriding")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Overriding {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInOverriding() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/inheritance/overriding"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@@ -4356,6 +4384,16 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/c-level-partition")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class C_level_partition {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInC_level_partition() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/c-level-partition"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@@ -4853,14 +4891,11 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Rationale {
|
||||||
public static class Rationale extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInRationale() throws Exception {
|
public void testAllFilesPresentInRationale() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -5136,6 +5171,16 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overloadable-operators")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Overloadable_operators {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInOverloadable_operators() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overloadable-operators"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@@ -5264,14 +5309,11 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/simple-assignments")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/simple-assignments")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Simple_assignments {
|
||||||
public static class Simple_assignments extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSimple_assignments() throws Exception {
|
public void testAllFilesPresentInSimple_assignments() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/simple-assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/simple-assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -5422,14 +5464,11 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Local_type_inference {
|
||||||
public static class Local_type_inference extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInLocal_type_inference() throws Exception {
|
public void testAllFilesPresentInLocal_type_inference() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -5496,14 +5535,11 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Smart_cast_types {
|
||||||
public static class Smart_cast_types extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSmart_cast_types() throws Exception {
|
public void testAllFilesPresentInSmart_cast_types() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
@@ -5657,6 +5693,16 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-nullable-types")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Subtyping_for_nullable_types {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInSubtyping_for_nullable_types() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-nullable-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@@ -5893,14 +5939,11 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters")
|
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
public class Type_parameters {
|
||||||
public static class Type_parameters extends AbstractDiagnosisCompilerTestDataSpecTest {
|
@Test
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInType_parameters() throws Exception {
|
public void testAllFilesPresentInType_parameters() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -10642,6 +10642,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadPriority.kt")
|
||||||
|
public void testOverloadPriority() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/overloadPriority.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("plusMatrix.kt")
|
@TestMetadata("plusMatrix.kt")
|
||||||
public void testPlusMatrix() throws Exception {
|
public void testPlusMatrix() throws Exception {
|
||||||
|
|||||||
+6
@@ -10642,6 +10642,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadPriority.kt")
|
||||||
|
public void testOverloadPriority() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/overloadPriority.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("plusMatrix.kt")
|
@TestMetadata("plusMatrix.kt")
|
||||||
public void testPlusMatrix() throws Exception {
|
public void testPlusMatrix() throws Exception {
|
||||||
|
|||||||
+4
@@ -113,6 +113,7 @@ abstract class AbstractConeCallConflictResolver(
|
|||||||
(variable as? FirProperty)?.typeParameters?.map { it.symbol.toLookupTag() }.orEmpty(),
|
(variable as? FirProperty)?.typeParameters?.map { it.symbol.toLookupTag() }.orEmpty(),
|
||||||
listOfNotNull(variable.receiverTypeRef?.coneType),
|
listOfNotNull(variable.receiverTypeRef?.coneType),
|
||||||
variable.receiverTypeRef != null,
|
variable.receiverTypeRef != null,
|
||||||
|
0, // TODO
|
||||||
false,
|
false,
|
||||||
0,
|
0,
|
||||||
(variable as? FirProperty)?.isExpect == true,
|
(variable as? FirProperty)?.isExpect == true,
|
||||||
@@ -127,6 +128,7 @@ abstract class AbstractConeCallConflictResolver(
|
|||||||
computeParameterTypes(call, constructor),
|
computeParameterTypes(call, constructor),
|
||||||
//constructor.receiverTypeRef != null,
|
//constructor.receiverTypeRef != null,
|
||||||
false,
|
false,
|
||||||
|
0, // TODO
|
||||||
constructor.valueParameters.any { it.isVararg },
|
constructor.valueParameters.any { it.isVararg },
|
||||||
call.numDefaults,
|
call.numDefaults,
|
||||||
constructor.isExpect,
|
constructor.isExpect,
|
||||||
@@ -140,6 +142,7 @@ abstract class AbstractConeCallConflictResolver(
|
|||||||
function.typeParameters.map { it.symbol.toLookupTag() },
|
function.typeParameters.map { it.symbol.toLookupTag() },
|
||||||
computeParameterTypes(call, function),
|
computeParameterTypes(call, function),
|
||||||
function.receiverTypeRef != null,
|
function.receiverTypeRef != null,
|
||||||
|
0, // TODO
|
||||||
function.valueParameters.any { it.isVararg },
|
function.valueParameters.any { it.isVararg },
|
||||||
call.numDefaults,
|
call.numDefaults,
|
||||||
function.isExpect,
|
function.isExpect,
|
||||||
@@ -168,6 +171,7 @@ abstract class AbstractConeCallConflictResolver(
|
|||||||
(klass as? FirTypeParameterRefsOwner)?.typeParameters?.map { it.symbol.toLookupTag() }.orEmpty(),
|
(klass as? FirTypeParameterRefsOwner)?.typeParameters?.map { it.symbol.toLookupTag() }.orEmpty(),
|
||||||
emptyList(),
|
emptyList(),
|
||||||
hasExtensionReceiver = false,
|
hasExtensionReceiver = false,
|
||||||
|
0, // TODO
|
||||||
hasVarargs = false,
|
hasVarargs = false,
|
||||||
numDefaults = 0,
|
numDefaults = 0,
|
||||||
isExpect = (klass as? FirRegularClass)?.isExpect == true,
|
isExpect = (klass as? FirRegularClass)?.isExpect == true,
|
||||||
|
|||||||
+4
-1
@@ -18,6 +18,7 @@ class FlatSignature<out T> constructor(
|
|||||||
val origin: T,
|
val origin: T,
|
||||||
val typeParameters: Collection<TypeParameterMarker>,
|
val typeParameters: Collection<TypeParameterMarker>,
|
||||||
val hasExtensionReceiver: Boolean,
|
val hasExtensionReceiver: Boolean,
|
||||||
|
val contextReceiverCount: Int,
|
||||||
val hasVarargs: Boolean,
|
val hasVarargs: Boolean,
|
||||||
val numDefaults: Int,
|
val numDefaults: Int,
|
||||||
val isExpect: Boolean,
|
val isExpect: Boolean,
|
||||||
@@ -31,12 +32,13 @@ class FlatSignature<out T> constructor(
|
|||||||
typeParameters: Collection<TypeParameterMarker>,
|
typeParameters: Collection<TypeParameterMarker>,
|
||||||
valueParameterTypes: List<KotlinTypeMarker?>,
|
valueParameterTypes: List<KotlinTypeMarker?>,
|
||||||
hasExtensionReceiver: Boolean,
|
hasExtensionReceiver: Boolean,
|
||||||
|
contextReceiverCount: Int,
|
||||||
hasVarargs: Boolean,
|
hasVarargs: Boolean,
|
||||||
numDefaults: Int,
|
numDefaults: Int,
|
||||||
isExpect: Boolean,
|
isExpect: Boolean,
|
||||||
isSyntheticMember: Boolean,
|
isSyntheticMember: Boolean,
|
||||||
) : this(
|
) : this(
|
||||||
origin, typeParameters, hasExtensionReceiver, hasVarargs, numDefaults, isExpect,
|
origin, typeParameters, hasExtensionReceiver, contextReceiverCount, hasVarargs, numDefaults, isExpect,
|
||||||
isSyntheticMember, valueParameterTypes.map(::TypeWithConversion)
|
isSyntheticMember, valueParameterTypes.map(::TypeWithConversion)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -106,6 +108,7 @@ fun <T> SimpleConstraintSystem.isSignatureNotLessSpecific(
|
|||||||
useOriginalSamTypes: Boolean = false
|
useOriginalSamTypes: Boolean = false
|
||||||
): Boolean {
|
): Boolean {
|
||||||
if (specific.hasExtensionReceiver != general.hasExtensionReceiver) return false
|
if (specific.hasExtensionReceiver != general.hasExtensionReceiver) return false
|
||||||
|
if (specific.contextReceiverCount != general.contextReceiverCount) return false
|
||||||
if (specific.valueParameterTypes.size != general.valueParameterTypes.size) return false
|
if (specific.valueParameterTypes.size != general.valueParameterTypes.size) return false
|
||||||
|
|
||||||
if (!isValueParameterTypeNotLessSpecific(specific, general, callbacks, specificityComparator) { it?.resultType }) {
|
if (!isValueParameterTypeNotLessSpecific(specific, general, callbacks, specificityComparator) { it?.resultType }) {
|
||||||
|
|||||||
+13
-4
@@ -27,6 +27,7 @@ fun <T> FlatSignature.Companion.createFromReflectionType(
|
|||||||
// Plus, currently, receiver for reflection type is taking from *candidate*, see buildReflectionType, this candidate can
|
// Plus, currently, receiver for reflection type is taking from *candidate*, see buildReflectionType, this candidate can
|
||||||
// have transient receiver which is not the same in its signature
|
// have transient receiver which is not the same in its signature
|
||||||
val receiver = descriptor.extensionReceiverParameter?.type
|
val receiver = descriptor.extensionReceiverParameter?.type
|
||||||
|
val contextReceiversTypes = descriptor.contextReceiverParameters.mapNotNull { it.type }
|
||||||
val parameters = reflectionType.getValueParameterTypesFromCallableReflectionType(
|
val parameters = reflectionType.getValueParameterTypesFromCallableReflectionType(
|
||||||
receiver != null && !hasBoundExtensionReceiver
|
receiver != null && !hasBoundExtensionReceiver
|
||||||
).map { it.type }
|
).map { it.type }
|
||||||
@@ -34,8 +35,9 @@ fun <T> FlatSignature.Companion.createFromReflectionType(
|
|||||||
return FlatSignature(
|
return FlatSignature(
|
||||||
origin,
|
origin,
|
||||||
descriptor.typeParameters,
|
descriptor.typeParameters,
|
||||||
listOfNotNull(receiver) + parameters,
|
contextReceiversTypes + listOfNotNull(receiver) + parameters,
|
||||||
hasExtensionReceiver = receiver != null,
|
hasExtensionReceiver = receiver != null,
|
||||||
|
contextReceiverCount = contextReceiversTypes.size,
|
||||||
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
||||||
numDefaults = numDefaults,
|
numDefaults = numDefaults,
|
||||||
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
||||||
@@ -52,12 +54,14 @@ fun <T> FlatSignature.Companion.create(
|
|||||||
parameterTypes: List<TypeWithConversion?>,
|
parameterTypes: List<TypeWithConversion?>,
|
||||||
): FlatSignature<T> {
|
): FlatSignature<T> {
|
||||||
val extensionReceiverType = descriptor.extensionReceiverParameter?.type
|
val extensionReceiverType = descriptor.extensionReceiverParameter?.type
|
||||||
|
val contextReceiverTypes = descriptor.contextReceiverParameters.mapNotNull { TypeWithConversion(it.type) }
|
||||||
|
|
||||||
return FlatSignature(
|
return FlatSignature(
|
||||||
origin,
|
origin,
|
||||||
descriptor.typeParameters,
|
descriptor.typeParameters,
|
||||||
valueParameterTypes = extensionReceiverType?.let { listOf(TypeWithConversion(it)) }.orEmpty() + parameterTypes,
|
valueParameterTypes = contextReceiverTypes + extensionReceiverType?.let { listOf(TypeWithConversion(it)) }.orEmpty() + parameterTypes,
|
||||||
hasExtensionReceiver = extensionReceiverType != null,
|
hasExtensionReceiver = extensionReceiverType != null,
|
||||||
|
contextReceiverCount = contextReceiverTypes.size,
|
||||||
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
||||||
numDefaults = numDefaults,
|
numDefaults = numDefaults,
|
||||||
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
||||||
@@ -72,12 +76,14 @@ fun <T> FlatSignature.Companion.create(
|
|||||||
parameterTypes: List<KotlinType?>
|
parameterTypes: List<KotlinType?>
|
||||||
): FlatSignature<T> {
|
): FlatSignature<T> {
|
||||||
val extensionReceiverType = descriptor.extensionReceiverParameter?.type
|
val extensionReceiverType = descriptor.extensionReceiverParameter?.type
|
||||||
|
val contextReceiverTypes = descriptor.contextReceiverParameters.mapNotNull { it.type }
|
||||||
|
|
||||||
return FlatSignature(
|
return FlatSignature(
|
||||||
origin,
|
origin,
|
||||||
descriptor.typeParameters,
|
descriptor.typeParameters,
|
||||||
valueParameterTypes = listOfNotNull(extensionReceiverType) + parameterTypes,
|
valueParameterTypes = contextReceiverTypes + listOfNotNull(extensionReceiverType) + parameterTypes,
|
||||||
hasExtensionReceiver = extensionReceiverType != null,
|
hasExtensionReceiver = extensionReceiverType != null,
|
||||||
|
contextReceiverCount = contextReceiverTypes.size,
|
||||||
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
||||||
numDefaults = numDefaults,
|
numDefaults = numDefaults,
|
||||||
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
||||||
@@ -89,9 +95,11 @@ fun <D : CallableDescriptor> FlatSignature.Companion.createFromCallableDescripto
|
|||||||
FlatSignature(
|
FlatSignature(
|
||||||
descriptor,
|
descriptor,
|
||||||
descriptor.typeParameters,
|
descriptor.typeParameters,
|
||||||
valueParameterTypes = listOfNotNull(descriptor.extensionReceiverParameter?.type)
|
valueParameterTypes = descriptor.contextReceiverParameters.map { it.type }
|
||||||
|
+ listOfNotNull(descriptor.extensionReceiverParameter?.type)
|
||||||
+ descriptor.valueParameters.map { it.argumentValueType },
|
+ descriptor.valueParameters.map { it.argumentValueType },
|
||||||
hasExtensionReceiver = descriptor.extensionReceiverParameter?.type != null,
|
hasExtensionReceiver = descriptor.extensionReceiverParameter?.type != null,
|
||||||
|
contextReceiverCount = descriptor.contextReceiverParameters.size,
|
||||||
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
||||||
numDefaults = 0,
|
numDefaults = 0,
|
||||||
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
||||||
@@ -104,6 +112,7 @@ fun <D : CallableDescriptor> FlatSignature.Companion.createForPossiblyShadowedEx
|
|||||||
descriptor.typeParameters,
|
descriptor.typeParameters,
|
||||||
valueParameterTypes = descriptor.valueParameters.map { it.argumentValueType },
|
valueParameterTypes = descriptor.valueParameters.map { it.argumentValueType },
|
||||||
hasExtensionReceiver = false,
|
hasExtensionReceiver = false,
|
||||||
|
contextReceiverCount = 0,
|
||||||
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
|
||||||
numDefaults = descriptor.valueParameters.count { it.hasDefaultValue() },
|
numDefaults = descriptor.valueParameters.count { it.hasDefaultValue() },
|
||||||
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
isExpect = descriptor is MemberDescriptor && descriptor.isExpect,
|
||||||
|
|||||||
+3
@@ -310,6 +310,9 @@ open class OverloadingConflictResolver<C : Any>(
|
|||||||
if (!call1.isExpect && call2.isExpect) return true
|
if (!call1.isExpect && call2.isExpect) return true
|
||||||
if (call1.isExpect && !call2.isExpect) return false
|
if (call1.isExpect && !call2.isExpect) return false
|
||||||
|
|
||||||
|
if (call1.contextReceiverCount > call2.contextReceiverCount) return true
|
||||||
|
if (call1.contextReceiverCount < call2.contextReceiverCount) return false
|
||||||
|
|
||||||
return createEmptyConstraintSystem().isSignatureNotLessSpecific(
|
return createEmptyConstraintSystem().isSignatureNotLessSpecific(
|
||||||
call1,
|
call1,
|
||||||
call2,
|
call2,
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
class Context
|
||||||
|
|
||||||
|
<!CONFLICTING_OVERLOADS!>context(Context)
|
||||||
|
fun f(): String<!> = TODO()
|
||||||
|
|
||||||
|
<!CONFLICTING_OVERLOADS!>fun f(): Any<!> = TODO()
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
with(Context()) {
|
||||||
|
f().length
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
class Context
|
||||||
|
|
||||||
|
context(Context)
|
||||||
|
fun f(): String = TODO()
|
||||||
|
|
||||||
|
fun f(): Any = TODO()
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
with(Context()) {
|
||||||
|
f().length
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun f(): kotlin.Any
|
||||||
|
public fun f(): kotlin.String
|
||||||
|
public fun test(): kotlin.Unit
|
||||||
|
|
||||||
|
public final class Context {
|
||||||
|
public constructor Context()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
Generated
+6
@@ -10648,6 +10648,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("overloadPriority.kt")
|
||||||
|
public void testOverloadPriority() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/overloadPriority.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("plusMatrix.kt")
|
@TestMetadata("plusMatrix.kt")
|
||||||
public void testPlusMatrix() throws Exception {
|
public void testPlusMatrix() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user