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:
Dmitry Jemerov
2016-01-13 16:37:19 +01:00
parent c1dbfee2a9
commit 8fdd8179b9
3 changed files with 15 additions and 2 deletions
@@ -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()
@@ -35,4 +35,8 @@ var Test.TEST: String
a.FOO = value
FOO = value
c.FOO = value
}
}
enum class My(val x: Int) {
FIRST(4)
}
@@ -35,4 +35,8 @@ var Test.TEST: String
FOO = value
b.FOO = value
c.FOO = value
}
}
enum class My(val x: Int) {
FIRST(4)
}