diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java index f39657bde07..d04a00447b5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java @@ -854,7 +854,7 @@ public class KtPsiUtil { return (KtElement) current; } } - if (current instanceof KtDelegatedSuperTypeEntry) { + if (current instanceof KtDelegatedSuperTypeEntry || current instanceof KtSuperTypeCallEntry) { PsiElement grandParent = current.getParent().getParent(); if (grandParent instanceof KtClassOrObject && !(grandParent.getParent() instanceof KtObjectLiteralExpression)) { return (KtElement) grandParent; diff --git a/idea/testData/resolve/additionalLazyResolve/anonymousObjectInBaseConstructor.kt b/idea/testData/resolve/additionalLazyResolve/anonymousObjectInBaseConstructor.kt new file mode 100644 index 00000000000..b2ea7410131 --- /dev/null +++ b/idea/testData/resolve/additionalLazyResolve/anonymousObjectInBaseConstructor.kt @@ -0,0 +1,25 @@ +package test + +interface A { + fun get(x : Int) +} + +open class B(val a: A) + +class C : B(object : A { + override fun get(x : Int) {} +}) + +//package test +//public interface A defined in test +//public abstract fun get(x: kotlin.Int): kotlin.Unit defined in test.A +//value-parameter x: kotlin.Int defined in test.A.get +//public open class B defined in test +//public constructor B(a: test.A) defined in test.B +//value-parameter a: test.A defined in test.B. +//public final class C : test.B defined in test +//public constructor C() defined in test.C +//local final class : test.A defined in test.C. +//public constructor () defined in test.C.. +//public open fun get(x: kotlin.Int): kotlin.Unit defined in test.C.. +//value-parameter x: kotlin.Int defined in test.C...get \ No newline at end of file diff --git a/idea/testData/resolve/additionalLazyResolve/functionLiteralInBaseConstructor.kt b/idea/testData/resolve/additionalLazyResolve/functionLiteralInBaseConstructor.kt new file mode 100644 index 00000000000..3b86d19dae9 --- /dev/null +++ b/idea/testData/resolve/additionalLazyResolve/functionLiteralInBaseConstructor.kt @@ -0,0 +1,14 @@ +package test + +open class B(val foo: () -> Unit) + +class C : B({ + +}) + +//package test +//public open class B defined in test +//public constructor B(foo: () -> kotlin.Unit) defined in test.B +//value-parameter foo: () -> kotlin.Unit defined in test.B. +//public final class C : test.B defined in test +//public constructor C() defined in test.C \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/resolve/AdditionalResolveDescriptorRendererTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/resolve/AdditionalResolveDescriptorRendererTestGenerated.java index d958df69050..91b2141d772 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/resolve/AdditionalResolveDescriptorRendererTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/resolve/AdditionalResolveDescriptorRendererTestGenerated.java @@ -36,6 +36,12 @@ public class AdditionalResolveDescriptorRendererTestGenerated extends AbstractAd KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/additionalLazyResolve"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("anonymousObjectInBaseConstructor.kt") + public void testAnonymousObjectInBaseConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/additionalLazyResolve/anonymousObjectInBaseConstructor.kt"); + doTest(fileName); + } + @TestMetadata("anonymousObjectInClassInitializer.kt") public void testAnonymousObjectInClassInitializer() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/additionalLazyResolve/anonymousObjectInClassInitializer.kt"); @@ -48,6 +54,12 @@ public class AdditionalResolveDescriptorRendererTestGenerated extends AbstractAd doTest(fileName); } + @TestMetadata("functionLiteralInBaseConstructor.kt") + public void testFunctionLiteralInBaseConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/additionalLazyResolve/functionLiteralInBaseConstructor.kt"); + doTest(fileName); + } + @TestMetadata("localClassInClassInitializer.kt") public void testLocalClassInClassInitializer() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/additionalLazyResolve/localClassInClassInitializer.kt");