diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index fbf874b47c4..ba0ec3b0f53 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -597,6 +597,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/kt57214.kt"); } + @Test + @TestMetadata("kt58583.kt") + public void testKt58583() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt58583.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index e8e9bf6ac0e..e909a91836b 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -597,6 +597,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/kt57214.kt"); } + @Test + @TestMetadata("kt58583.kt") + public void testKt58583() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt58583.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 95c183f1b22..55de1eec8c0 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -597,6 +597,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/kt57214.kt"); } + @Test + @TestMetadata("kt58583.kt") + public void testKt58583() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt58583.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 24cd4be6c06..280360ddedb 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -597,6 +597,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/kt57214.kt"); } + @Test + @TestMetadata("kt58583.kt") + public void testKt58583() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt58583.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSupertypesResolution.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSupertypesResolution.kt index 31585887c15..f49cad6d677 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSupertypesResolution.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSupertypesResolution.kt @@ -12,7 +12,6 @@ import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.utils.expandedConeType 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.DiagnosticKind import org.jetbrains.kotlin.fir.expressions.FirStatement @@ -624,7 +623,7 @@ open class SupertypeComputationSession { protected open fun getResolvedSuperTypeRefsForOutOfSessionDeclaration( classLikeDeclaration: FirClassLikeDeclaration, ): List? = when (classLikeDeclaration) { - is FirRegularClass -> classLikeDeclaration.superTypeRefs.filterIsInstance() + is FirClass -> classLikeDeclaration.superTypeRefs.filterIsInstance() is FirTypeAlias -> listOfNotNull(classLikeDeclaration.expandedTypeRef as? FirResolvedTypeRef) else -> null } diff --git a/compiler/testData/diagnostics/tests/kt58583.kt b/compiler/testData/diagnostics/tests/kt58583.kt new file mode 100644 index 00000000000..105804fcfc3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt58583.kt @@ -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() {} + } + } +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index c5e1bdcf248..c4c50b5687e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -597,6 +597,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/kt57214.kt"); } + @Test + @TestMetadata("kt58583.kt") + public void testKt58583() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt58583.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception {