Skip to content

Commit 27f5ddc

Browse files
committed
Rename: Report redeclaration conflict between class and type alias
#KT-22751 Fixed
1 parent a341392 commit 27f5ddc

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

idea/src/org/jetbrains/kotlin/idea/refactoring/rename/renameConflictUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ internal fun checkRedeclarations(
9999

100100
fun MemberScope.findSiblingsByName(): List<DeclarationDescriptor> {
101101
val descriptorKindFilter = when (descriptor) {
102-
is ClassDescriptor -> DescriptorKindFilter.CLASSIFIERS
102+
is ClassifierDescriptor -> DescriptorKindFilter.CLASSIFIERS
103103
is PropertyDescriptor -> DescriptorKindFilter.VARIABLES
104104
is FunctionDescriptor -> DescriptorKindFilter.FUNCTIONS
105105
else -> return emptyList()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
actual typealias Foo = Foo
2+
3+
class Foo
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
actual typealias /*rename*/A = Foo
2+
3+
class Foo
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "MARKED_ELEMENT",
3+
"mainFile": "test.kt",
4+
"newName": "Foo",
5+
"withRuntime": "true",
6+
"hint": "Class 'Foo' is already declared in package"
7+
}

idea/tests/org/jetbrains/kotlin/idea/refactoring/rename/RenameTestGenerated.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)