Do not try to inline properties from decompiled files

This removes GUI freeze for library properties #KT-17234 Fixed
This commit is contained in:
Mikhail Glukhikh
2017-04-14 15:20:10 +03:00
parent 983611a75f
commit 8fdb611e3b
2 changed files with 4 additions and 1 deletions
@@ -61,6 +61,9 @@ class KotlinInlineValHandler : InlineActionHandler() {
val declaration = element as KtProperty
val file = declaration.containingKtFile
val name = declaration.name ?: return
if (file.isCompiled) {
return showErrorHint(project, editor, "Cannot inline '$name' from a decompiled file")
}
val references = ReferencesSearch.search(declaration)
val referenceExpressions = mutableListOf<KtExpression>()
@@ -1,4 +1,4 @@
// ERROR: Cannot perform refactoring.\nVariable length has no initializer
// ERROR: Cannot inline 'length' from a decompiled file
fun foo(s: String) {
val l = s.<caret>length