Rename: Report redeclaration conflict between class and type alias
#KT-22751 Fixed
This commit is contained in:
@@ -99,7 +99,7 @@ internal fun checkRedeclarations(
|
|||||||
|
|
||||||
fun MemberScope.findSiblingsByName(): List<DeclarationDescriptor> {
|
fun MemberScope.findSiblingsByName(): List<DeclarationDescriptor> {
|
||||||
val descriptorKindFilter = when (descriptor) {
|
val descriptorKindFilter = when (descriptor) {
|
||||||
is ClassDescriptor -> DescriptorKindFilter.CLASSIFIERS
|
is ClassifierDescriptor -> DescriptorKindFilter.CLASSIFIERS
|
||||||
is PropertyDescriptor -> DescriptorKindFilter.VARIABLES
|
is PropertyDescriptor -> DescriptorKindFilter.VARIABLES
|
||||||
is FunctionDescriptor -> DescriptorKindFilter.FUNCTIONS
|
is FunctionDescriptor -> DescriptorKindFilter.FUNCTIONS
|
||||||
else -> return emptyList()
|
else -> return emptyList()
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
actual typealias Foo = Foo
|
||||||
|
|
||||||
|
class Foo
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
actual typealias /*rename*/A = Foo
|
||||||
|
|
||||||
|
class Foo
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"type": "MARKED_ELEMENT",
|
||||||
|
"mainFile": "test.kt",
|
||||||
|
"newName": "Foo",
|
||||||
|
"withRuntime": "true",
|
||||||
|
"hint": "Class 'Foo' is already declared in package"
|
||||||
|
}
|
||||||
+6
@@ -157,6 +157,12 @@ public class RenameTestGenerated extends AbstractRenameTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classAndTypeAliasRedeclaration/classAndTypeAliasRedeclaration.test")
|
||||||
|
public void testClassAndTypeAliasRedeclaration_ClassAndTypeAliasRedeclaration() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/rename/classAndTypeAliasRedeclaration/classAndTypeAliasRedeclaration.test");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("classByPrimaryConstructor/classByPrimaryConstructor.test")
|
@TestMetadata("classByPrimaryConstructor/classByPrimaryConstructor.test")
|
||||||
public void testClassByPrimaryConstructor_ClassByPrimaryConstructor() throws Exception {
|
public void testClassByPrimaryConstructor_ClassByPrimaryConstructor() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/rename/classByPrimaryConstructor/classByPrimaryConstructor.test");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/rename/classByPrimaryConstructor/classByPrimaryConstructor.test");
|
||||||
|
|||||||
Reference in New Issue
Block a user