Extraction Engine: Report conflict on all diagnostics from UNRESOLVED_REFERENCE group
#KT-9117 Fixed
This commit is contained in:
+1
-1
@@ -1020,7 +1020,7 @@ fun ExtractableCodeDescriptor.validate(): ExtractableCodeDescriptorWithConflicts
|
|||||||
if (currentDescriptor is LocalVariableDescriptor
|
if (currentDescriptor is LocalVariableDescriptor
|
||||||
&& parameters.any { it.mirrorVarName == currentDescriptor.getName().asString() }) continue
|
&& parameters.any { it.mirrorVarName == currentDescriptor.getName().asString() }) continue
|
||||||
|
|
||||||
if (diagnostics.any { it.getFactory() == Errors.UNRESOLVED_REFERENCE }
|
if (diagnostics.any { it.getFactory() in Errors.UNRESOLVED_REFERENCE_DIAGNOSTICS }
|
||||||
|| (currentDescriptor != null
|
|| (currentDescriptor != null
|
||||||
&& !ErrorUtils.isError(currentDescriptor)
|
&& !ErrorUtils.isError(currentDescriptor)
|
||||||
&& !comparePossiblyOverridingDescriptors(extractionData.project, currentDescriptor, resolveResult.descriptor))) {
|
&& !comparePossiblyOverridingDescriptors(extractionData.project, currentDescriptor, resolveResult.descriptor))) {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// SIBLING:
|
||||||
|
class A {
|
||||||
|
fun foo() {
|
||||||
|
val a = B()
|
||||||
|
<selection>a.unresolved()</selection>
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun B.unresolved() = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
class B
|
||||||
|
|
||||||
|
private fun A.unresolved() = 1
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Function A.unresolved will no longer be accessible after extraction
|
||||||
+6
@@ -695,6 +695,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
|
|||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/extractFunction/basic/traitFunction.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/extractFunction/basic/traitFunction.kt");
|
||||||
doExtractFunctionTest(fileName);
|
doExtractFunctionTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("unresolvedWrongReceiver.kt")
|
||||||
|
public void testUnresolvedWrongReceiver() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/extractFunction/basic/unresolvedWrongReceiver.kt");
|
||||||
|
doExtractFunctionTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/refactoring/extractFunction/controlFlow")
|
@TestMetadata("idea/testData/refactoring/extractFunction/controlFlow")
|
||||||
|
|||||||
Reference in New Issue
Block a user