[FIR] SupertypeComputationSession: fix false positive invisible reference for local object
The problem is that FirAnonymousObject was ignored during getResolvedSuperTypeRefsForOutOfSessionDeclaration from SupertypeSupplier ^KT-58583 Fixed
This commit is contained in:
committed by
Space Team
parent
c6d9821ef0
commit
2c294cba64
+6
@@ -597,6 +597,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt58583.kt")
|
||||||
|
public void testKt58583() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
+6
@@ -597,6 +597,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt58583.kt")
|
||||||
|
public void testKt58583() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
+6
@@ -597,6 +597,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt58583.kt")
|
||||||
|
public void testKt58583() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
+6
@@ -597,6 +597,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt58583.kt")
|
||||||
|
public void testKt58583() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
+1
-2
@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.fir.*
|
|||||||
import org.jetbrains.kotlin.fir.declarations.*
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.expandedConeType
|
import org.jetbrains.kotlin.fir.declarations.utils.expandedConeType
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.isCompanion
|
import org.jetbrains.kotlin.fir.declarations.utils.isCompanion
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.superConeTypes
|
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
|
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
|
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||||
@@ -624,7 +623,7 @@ open class SupertypeComputationSession {
|
|||||||
protected open fun getResolvedSuperTypeRefsForOutOfSessionDeclaration(
|
protected open fun getResolvedSuperTypeRefsForOutOfSessionDeclaration(
|
||||||
classLikeDeclaration: FirClassLikeDeclaration,
|
classLikeDeclaration: FirClassLikeDeclaration,
|
||||||
): List<FirResolvedTypeRef>? = when (classLikeDeclaration) {
|
): List<FirResolvedTypeRef>? = when (classLikeDeclaration) {
|
||||||
is FirRegularClass -> classLikeDeclaration.superTypeRefs.filterIsInstance<FirResolvedTypeRef>()
|
is FirClass -> classLikeDeclaration.superTypeRefs.filterIsInstance<FirResolvedTypeRef>()
|
||||||
is FirTypeAlias -> listOfNotNull(classLikeDeclaration.expandedTypeRef as? FirResolvedTypeRef)
|
is FirTypeAlias -> listOfNotNull(classLikeDeclaration.expandedTypeRef as? FirResolvedTypeRef)
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
|
||||||
|
// FILE: DialogWrapper.kt
|
||||||
|
package pkg
|
||||||
|
|
||||||
|
open class DialogWrapper {
|
||||||
|
protected open class DialogWrapperAction
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: Main.kt
|
||||||
|
import pkg.DialogWrapper
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
object: DialogWrapper() {
|
||||||
|
init {
|
||||||
|
object: DialogWrapperAction() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -597,6 +597,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
runTest("compiler/testData/diagnostics/tests/kt57214.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt58583.kt")
|
||||||
|
public void testKt58583() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user