diff --git a/idea/tests/org/jetbrains/kotlin/idea/ResolveElementCacheTest.kt b/idea/tests/org/jetbrains/kotlin/idea/ResolveElementCacheTest.kt index 2112fbcf0e7..9fcebc9b9f2 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/ResolveElementCacheTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/ResolveElementCacheTest.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.idea import com.intellij.psi.PsiDocumentManager -import com.intellij.psi.util.parentOfType import junit.framework.TestCase import org.intellij.lang.annotations.Language import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor @@ -32,6 +31,7 @@ import org.jetbrains.kotlin.idea.util.application.executeWriteCommand import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.findDescendantOfType +import org.jetbrains.kotlin.psi.psiUtil.getParentOfType import org.jetbrains.kotlin.psi.psiUtil.startOffset import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe @@ -390,7 +390,7 @@ class C(param1: String = "", param2: Int = 0) { class My(param: Int = 0) """) as KtFile - val defaultValue = myFixture.elementByOffset.parentOfType()!! + val defaultValue = myFixture.elementByOffset.getParentOfType(true)!! // Kept to preserve correct behaviour of analyzeFully() on class internal elements @Suppress("DEPRECATION") @@ -404,7 +404,7 @@ class C(param1: String = "", param2: Int = 0) { """ ) as KtFile - val annotationArguments = myFixture.elementByOffset.parentOfType()!! + val annotationArguments = myFixture.elementByOffset.getParentOfType(true)!! @Suppress("DEPRECATION") annotationArguments.analyzeWithAllCompilerChecks() @@ -419,7 +419,7 @@ class C(param1: String = "", param2: Int = 0) { """) as KtFile val function = (file.declarations[1]) as KtFunction - val typeRef = myFixture.elementByOffset.parentOfType()!! + val typeRef = myFixture.elementByOffset.getParentOfType(true)!! val bindingContext = typeRef.analyze(BodyResolveMode.PARTIAL) @@ -437,7 +437,7 @@ class C(param1: String = "", param2: Int = 0) { class X(@set:Ann var p: Int) """) as KtFile - val typeRef = myFixture.elementByOffset.parentOfType()!! + val typeRef = myFixture.elementByOffset.getParentOfType(true)!! val bindingContext = typeRef.analyze(BodyResolveMode.PARTIAL) @@ -457,7 +457,7 @@ class C(param1: String = "", param2: Int = 0) { """) as KtFile val constructor = ((file.declarations[1]) as KtClass).getSecondaryConstructors()[0] - val typeRef = myFixture.elementByOffset.parentOfType()!! + val typeRef = myFixture.elementByOffset.getParentOfType(true)!! val bindingContext = typeRef.analyze(BodyResolveMode.PARTIAL) @@ -531,7 +531,7 @@ class C(param1: String = "", param2: Int = 0) { } """) as KtFile - val methodOne = myFixture.elementByOffset.parentOfType()!! + val methodOne = myFixture.elementByOffset.getParentOfType(true)!! val bindingContext = methodOne.analyze(BodyResolveMode.FULL)