KT-11750 Do not report REDECLARATION on descriptors which are not available in sources.
This commit is contained in:
@@ -78,9 +78,13 @@ class DeclarationResolver(
|
||||
continue
|
||||
}
|
||||
|
||||
redeclarations.add(Pair(DescriptorToSourceUtils.getSourceFromDescriptor(descriptor)!!, descriptor.getName()))
|
||||
DescriptorToSourceUtils.getSourceFromDescriptor(descriptor)?.let {
|
||||
redeclarations.add(Pair(it, descriptor.getName()))
|
||||
}
|
||||
if (descriptor2 is PropertyDescriptor) {
|
||||
redeclarations.add(Pair(DescriptorToSourceUtils.descriptorToDeclaration(descriptor2)!!, descriptor2.getName()))
|
||||
DescriptorToSourceUtils.descriptorToDeclaration(descriptor2)?.let {
|
||||
redeclarations.add(Pair(it, descriptor2.getName()))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
enum class A {
|
||||
<!REDECLARATION!>name<!>
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
public final enum class A : kotlin.Enum<A> {
|
||||
enum entry name
|
||||
|
||||
private constructor A()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): A
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<A>
|
||||
}
|
||||
@@ -13377,6 +13377,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("EnumName.kt")
|
||||
public void testEnumName() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/redeclarations/EnumName.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("FunVsCtorInDifferentFiles.kt")
|
||||
public void testFunVsCtorInDifferentFiles() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/redeclarations/FunVsCtorInDifferentFiles.kt");
|
||||
|
||||
Reference in New Issue
Block a user