Workaround for KtEnumEntrySuperclassReferenceExpression which implements KtSimpleNameExpression in a weird way and can break Move refactoring (EA-75268 - assert: TextRange.<init>)
This commit is contained in:
@@ -98,6 +98,11 @@ fun KtElement.lazilyProcessInternalReferencesToUpdateOnPackageNameChange(
|
||||
|
||||
val declaration = DescriptorToSourceUtilsIde.getAnyDeclaration(project, descriptor) ?: return null
|
||||
|
||||
// Special case for enum entry superclass references (they have empty text and don't need to be processed by the refactoring)
|
||||
if (refExpr.textRange.isEmpty) {
|
||||
return null
|
||||
}
|
||||
|
||||
val isCallable = descriptor is CallableDescriptor
|
||||
val isExtension = isCallable && declaration.isExtensionDeclaration()
|
||||
|
||||
|
||||
+5
-1
@@ -35,4 +35,8 @@ var Test.TEST: String
|
||||
a.FOO = value
|
||||
FOO = value
|
||||
c.FOO = value
|
||||
}
|
||||
}
|
||||
|
||||
enum class My(val x: Int) {
|
||||
FIRST(4)
|
||||
}
|
||||
|
||||
+5
-1
@@ -35,4 +35,8 @@ var Test.TEST: String
|
||||
FOO = value
|
||||
b.FOO = value
|
||||
c.FOO = value
|
||||
}
|
||||
}
|
||||
|
||||
enum class My(val x: Int) {
|
||||
FIRST(4)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user