Fix an exception caused by objects literals in supertype list not considered local
This commit is contained in:
@@ -817,6 +817,9 @@ public class KtPsiUtil {
|
||||
if (current instanceof KtBlockExpression || current instanceof KtParameter) {
|
||||
return (KtElement) current;
|
||||
}
|
||||
if (current instanceof KtValueArgument) {
|
||||
return (KtElement) current;
|
||||
}
|
||||
|
||||
current = parent;
|
||||
}
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
annotation class A
|
||||
|
||||
class B
|
||||
|
||||
@A(B.class<error>)</error>
|
||||
<error>fun</error> <error>f</error><error>(</error><error>)</error> <error><error>{</error>}</error>
|
||||
@@ -0,0 +1,5 @@
|
||||
interface A
|
||||
|
||||
open class B(<warning>i</warning>: Int, <warning>a</warning>: A)
|
||||
|
||||
class C() : B(3, object : A {})
|
||||
@@ -418,6 +418,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("javaStyleClassLiteralInAnnotationArguments.kt")
|
||||
public void testJavaStyleClassLiteralInAnnotationArguments() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/regression/javaStyleClassLiteralInAnnotationArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Jet11.kt")
|
||||
public void testJet11() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/regression/Jet11.kt");
|
||||
@@ -496,6 +502,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("objectLiteralInSupertypeList.kt")
|
||||
public void testObjectLiteralInSupertypeList() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/regression/objectLiteralInSupertypeList.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OverrideResolution.kt")
|
||||
public void testOverrideResolution() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/regression/OverrideResolution.kt");
|
||||
|
||||
Reference in New Issue
Block a user