diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.java b/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.java index 0462f80a4d7..bbde49edb73 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.java +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/GotoSuperActionHandler.java @@ -65,7 +65,7 @@ public class GotoSuperActionHandler implements CodeInsightActionHandler { List superDeclarations = findSuperDeclarations(descriptor); - if (superDeclarations.isEmpty()) return; + if (superDeclarations == null || superDeclarations.isEmpty()) return; if (superDeclarations.size() == 1) { Navigatable navigatable = EditSourceUtil.getDescriptor(superDeclarations.get(0)); if (navigatable != null && navigatable.canNavigate()) { @@ -100,6 +100,7 @@ public class GotoSuperActionHandler implements CodeInsightActionHandler { return null; } + @Nullable private static List findSuperDeclarations(DeclarationDescriptor descriptor) { Collection superDescriptors; if (descriptor instanceof ClassDescriptor) { diff --git a/idea/testData/navigation/gotoSuper/BadPositionLambdaParameter.test b/idea/testData/navigation/gotoSuper/BadPositionLambdaParameter.test new file mode 100644 index 00000000000..e8c81e6d084 --- /dev/null +++ b/idea/testData/navigation/gotoSuper/BadPositionLambdaParameter.test @@ -0,0 +1,8 @@ +// FILE: before.kt +fun test() { + val a = { a: Int -> 1} +} +// FILE: after.kt +fun test() { + val a = { a: Int -> 1} +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/navigation/GotoSuperTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/navigation/GotoSuperTestGenerated.java index e54aac3bd68..fdb22a0eb9c 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/navigation/GotoSuperTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/navigation/GotoSuperTestGenerated.java @@ -35,6 +35,12 @@ public class GotoSuperTestGenerated extends AbstractGotoSuperTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/navigation/gotoSuper"), Pattern.compile("^(.+)\\.test$"), true); } + @TestMetadata("BadPositionLambdaParameter.test") + public void testBadPositionLambdaParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/navigation/gotoSuper/BadPositionLambdaParameter.test"); + doTest(fileName); + } + @TestMetadata("ClassSimple.test") public void testClassSimple() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/navigation/gotoSuper/ClassSimple.test");