Fix tests
This commit is contained in:
@@ -28,13 +28,12 @@ import org.jetbrains.kotlin.descriptors.annotations.KotlinTarget
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptor
|
||||
import org.jetbrains.kotlin.idea.core.ShortenReferences
|
||||
import org.jetbrains.kotlin.idea.refactoring.isInterfaceClass
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.descriptor
|
||||
import org.jetbrains.kotlin.idea.util.CommentSaver
|
||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
||||
import org.jetbrains.kotlin.lexer.KtTokens.VARARG_KEYWORD
|
||||
import org.jetbrains.kotlin.lexer.KtTokens.LATEINIT_KEYWORD
|
||||
import org.jetbrains.kotlin.lexer.KtTokens.VARARG_KEYWORD
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
import org.jetbrains.kotlin.resolve.AnnotationChecker
|
||||
@@ -56,8 +55,8 @@ class MovePropertyToConstructorIntention :
|
||||
|
||||
override fun isApplicableTo(element: KtProperty, caretOffset: Int): Boolean {
|
||||
fun KtProperty.isDeclaredInClass() : Boolean {
|
||||
val parent = element.getStrictParentOfType<KtClassOrObject>()
|
||||
return parent != null && !parent.isInterfaceClass()
|
||||
val parent = getStrictParentOfType<KtClassOrObject>()
|
||||
return parent is KtClass && !parent.isInterface()
|
||||
}
|
||||
|
||||
return !element.isLocal
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// "Change type of overriden property 'A.x' to '(Int) -> Int'" "false"
|
||||
// ACTION: Change type to '(String) -> Int'
|
||||
// ACTION: Move to constructor
|
||||
// ERROR: Type of 'x' is not a subtype of the overridden property 'public abstract val x: (String) -> Int defined in A'
|
||||
interface A {
|
||||
val x: (String) -> Int
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// "Change type to '(String) -> [ERROR : Ay]'" "false"
|
||||
// ACTION: Change type of base property 'A.x' to '(Int) -> Int'
|
||||
// ACTION: Move to constructor
|
||||
// ERROR: Type of 'x' is not a subtype of the overridden property 'public abstract val x: (String) -> [ERROR : Ay] defined in A'
|
||||
// ERROR: Unresolved reference: Ay
|
||||
interface A {
|
||||
|
||||
Reference in New Issue
Block a user