FIR: correctly process accessor symbols in derived classes
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ class JavaClassEnhancementScope(
|
||||
) as FirAccessorSymbol
|
||||
}
|
||||
else -> {
|
||||
if (original is FirPropertySymbol) return original
|
||||
if (original is FirPropertySymbol || original is FirAccessorSymbol) return original
|
||||
error("Can't make enhancement for $original: `${firElement.render()}`")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ class JavaClassUseSiteMemberScope(
|
||||
processor(it)
|
||||
} else {
|
||||
val overriddenBy = it.getOverridden(overrideCandidates)
|
||||
if (overriddenBy == null && it is FirVariableSymbol<*>) {
|
||||
if (overriddenBy == null) {
|
||||
processor(it)
|
||||
} else {
|
||||
NEXT
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// FILE: PsiElement.java
|
||||
|
||||
public interface PsiElement {
|
||||
PsiElement[] getChildren();
|
||||
}
|
||||
|
||||
// FILE: XmlTag.java
|
||||
|
||||
public interface XmlTag extends PsiElement {
|
||||
String getLocalName();
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(tag: XmlTag, name: String): List<XmlTag> {
|
||||
val result = tag.children.filterIsInstance<XmlTag>().filter { it.localName == name }
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
FILE: test.kt
|
||||
public final fun foo(tag: R|XmlTag|, name: R|kotlin/String|): R|kotlin/collections/List<XmlTag>| {
|
||||
lval result: R|kotlin/collections/List<XmlTag>| = R|<local>/tag|.R|/PsiElement.children|.R|kotlin/collections/filterIsInstance|<R|XmlTag|>().R|kotlin/collections/filter|<R|XmlTag|>(<L> = filter@fun <anonymous>(it: R|XmlTag|): R|kotlin/Boolean| <kind=UNKNOWN> {
|
||||
==(R|<local>/it|.R|/XmlTag.localName|, R|<local>/name|)
|
||||
}
|
||||
)
|
||||
^foo R|<local>/result|
|
||||
}
|
||||
Generated
+5
@@ -529,6 +529,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/StaticGenericMethod.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticAfterFiltering.kt")
|
||||
public void testSyntheticAfterFiltering() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/SyntheticAfterFiltering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticWithForEach.kt")
|
||||
public void testSyntheticWithForEach() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/SyntheticWithForEach.kt");
|
||||
|
||||
Reference in New Issue
Block a user