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
|
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 isCallable = descriptor is CallableDescriptor
|
||||||
val isExtension = isCallable && declaration.isExtensionDeclaration()
|
val isExtension = isCallable && declaration.isExtensionDeclaration()
|
||||||
|
|
||||||
|
|||||||
+4
@@ -36,3 +36,7 @@ var Test.TEST: String
|
|||||||
FOO = value
|
FOO = value
|
||||||
c.FOO = value
|
c.FOO = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class My(val x: Int) {
|
||||||
|
FIRST(4)
|
||||||
|
}
|
||||||
|
|||||||
+4
@@ -36,3 +36,7 @@ var Test.TEST: String
|
|||||||
b.FOO = value
|
b.FOO = value
|
||||||
c.FOO = value
|
c.FOO = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class My(val x: Int) {
|
||||||
|
FIRST(4)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user