diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 68d0edf3bae..607917ffe52 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -15881,6 +15881,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.kt"); } + @Test + @TestMetadata("supertypeUsesNested.kt") + public void testSupertypeUsesNested() throws Exception { + runTest("compiler/testData/diagnostics/tests/j+k/supertypeUsesNested.kt"); + } + @Test @TestMetadata("traitDefaultCall.kt") public void testTraitDefaultCall() throws Exception { diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt index f61df5dda07..4525b835cc9 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt @@ -610,7 +610,7 @@ private fun JavaType?.toConeProjectionWithoutEnhancement( } } } - is JavaClassifierType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, isForSupertypes) + is JavaClassifierType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, isForSupertypes = isForSupertypes) is JavaArrayType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, isForSupertypes = isForSupertypes) else -> ConeClassErrorType(ConeSimpleDiagnostic("Unexpected type argument: $this", DiagnosticKind.Java)) } diff --git a/compiler/testData/diagnostics/tests/j+k/supertypeUsesNested.kt b/compiler/testData/diagnostics/tests/j+k/supertypeUsesNested.kt new file mode 100644 index 00000000000..86610986ba3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/supertypeUsesNested.kt @@ -0,0 +1,23 @@ +// FIR_IDENTICAL +// SKIP_TXT +// FILE: JavaClass.java +public class JavaClass extends ContainerType> { + public static class Nested extends Container {} +} + +// FILE: ContainerType.java +public class ContainerType {} + +// FILE: Container.java +public class Container {} + +// FILE: Usage.java +public class Usage { + public static JavaClass.Nested foo() { return null; } +} + +// FILE: main.kt + +fun main() { + Usage.foo().hashCode() +} 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 8069f0a16b2..4b144e033e6 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 @@ -15887,6 +15887,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.kt"); } + @Test + @TestMetadata("supertypeUsesNested.kt") + public void testSupertypeUsesNested() throws Exception { + runTest("compiler/testData/diagnostics/tests/j+k/supertypeUsesNested.kt"); + } + @Test @TestMetadata("traitDefaultCall.kt") public void testTraitDefaultCall() throws Exception {