KT-62675 [AA] Handle labeled this expressions in reference shortener
At the moment, there is no good way to meaningfully filter `this` expressions. The filters for the reference shortener can work only with symbols, and it does not make a lot of sense to check any particular symbol when deciding whether to shorten a labeled `this` expression. We would probably need a better API for the shortener to be able to filter more precisely (see KT-63555) ^KT-62675 Fixed
This commit is contained in:
+58
@@ -950,6 +950,64 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceShortenerTestGenera
|
||||
public void testThis_safeCall() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/this_safeCall.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithLabel {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithLabel() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionReceiver.kt")
|
||||
public void testExtensionReceiver() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/extensionReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionReceiver_vs_lambdaReceiver.kt")
|
||||
public void testExtensionReceiver_vs_lambdaReceiver() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/extensionReceiver_vs_lambdaReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionReceiver_vs_local.kt")
|
||||
public void testExtensionReceiver_vs_local() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/extensionReceiver_vs_local.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaReceiver.kt")
|
||||
public void testLambdaReceiver() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/lambdaReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaReceiver_vs_lambdaReceiver.kt")
|
||||
public void testLambdaReceiver_vs_lambdaReceiver() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/lambdaReceiver_vs_lambdaReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("regularClass.kt")
|
||||
public void testRegularClass() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/regularClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("regularClass_vs_extensionReceiver.kt")
|
||||
public void testRegularClass_vs_extensionReceiver() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/regularClass_vs_extensionReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("regularClass_vs_innerClass.kt")
|
||||
public void testRegularClass_vs_innerClass() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/thisReference/withLabel/regularClass_vs_innerClass.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
Reference in New Issue
Block a user