NI: don't do substitution for unsupported callable descriptors to use as callable references

^KT-41729 Fixed
This commit is contained in:
Victor Petukhov
2020-09-09 11:55:18 +03:00
parent 668098f3a8
commit 685d16ec68
27 changed files with 247 additions and 55 deletions
@@ -1791,11 +1791,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt");
}
@TestMetadata("callableReferenceToLocalVariable.kt")
public void testCallableReferenceToLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/callableReferenceToLocalVariable.kt");
}
@TestMetadata("classVsPackage.kt")
public void testClassVsPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt");
@@ -2562,11 +2557,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.kt");
}
@TestMetadata("localVariable.kt")
public void testLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/localVariable.kt");
}
@TestMetadata("memberFromTopLevel.kt")
public void testMemberFromTopLevel() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
@@ -2587,11 +2577,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.kt");
}
@TestMetadata("syntheticProperties.kt")
public void testSyntheticProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/syntheticProperties.kt");
}
@TestMetadata("topLevelFromTopLevel.kt")
public void testTopLevelFromTopLevel() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/topLevelFromTopLevel.kt");
@@ -2860,6 +2845,44 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/withVararg.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/callableReference/unsupported")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Unsupported extends AbstractDiagnosticsTestWithFirValidation {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInUnsupported() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/callableReference/unsupported"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("callableReferenceToLocalVariable.kt")
public void testCallableReferenceToLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/callableReferenceToLocalVariable.kt");
}
@TestMetadata("localVariable.kt")
public void testLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/localVariable.kt");
}
@TestMetadata("localVariableWithSubstitution.kt")
public void testLocalVariableWithSubstitution() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/localVariableWithSubstitution.kt");
}
@TestMetadata("parameterWithSubstitution.kt")
public void testParameterWithSubstitution() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/parameterWithSubstitution.kt");
}
@TestMetadata("syntheticProperties.kt")
public void testSyntheticProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/syntheticProperties.kt");
}
}
}
@TestMetadata("compiler/testData/diagnostics/tests/cast")
@@ -3058,6 +3058,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
runTest("compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.kt");
}
@TestMetadata("callableReferenceOnParameter.kt")
public void testCallableReferenceOnParameter() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.kt");
}
@TestMetadata("integerLiterals.kt")
public void testIntegerLiterals() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/inference/integerLiterals.kt");
@@ -3058,6 +3058,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
runTest("compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.kt");
}
@TestMetadata("callableReferenceOnParameter.kt")
public void testCallableReferenceOnParameter() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.kt");
}
@TestMetadata("integerLiterals.kt")
public void testIntegerLiterals() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/inference/integerLiterals.kt");
@@ -1786,11 +1786,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt");
}
@TestMetadata("callableReferenceToLocalVariable.kt")
public void testCallableReferenceToLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/callableReferenceToLocalVariable.kt");
}
@TestMetadata("classVsPackage.kt")
public void testClassVsPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt");
@@ -2557,11 +2552,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.kt");
}
@TestMetadata("localVariable.kt")
public void testLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/localVariable.kt");
}
@TestMetadata("memberFromTopLevel.kt")
public void testMemberFromTopLevel() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/memberFromTopLevel.kt");
@@ -2582,11 +2572,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.kt");
}
@TestMetadata("syntheticProperties.kt")
public void testSyntheticProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/syntheticProperties.kt");
}
@TestMetadata("topLevelFromTopLevel.kt")
public void testTopLevelFromTopLevel() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/property/topLevelFromTopLevel.kt");
@@ -2855,6 +2840,44 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/withVararg.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/callableReference/unsupported")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Unsupported extends AbstractDiagnosticsUsingJavacTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInUnsupported() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/callableReference/unsupported"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("callableReferenceToLocalVariable.kt")
public void testCallableReferenceToLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/callableReferenceToLocalVariable.kt");
}
@TestMetadata("localVariable.kt")
public void testLocalVariable() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/localVariable.kt");
}
@TestMetadata("localVariableWithSubstitution.kt")
public void testLocalVariableWithSubstitution() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/localVariableWithSubstitution.kt");
}
@TestMetadata("parameterWithSubstitution.kt")
public void testParameterWithSubstitution() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/parameterWithSubstitution.kt");
}
@TestMetadata("syntheticProperties.kt")
public void testSyntheticProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/callableReference/unsupported/syntheticProperties.kt");
}
}
}
@TestMetadata("compiler/testData/diagnostics/tests/cast")