diff --git a/compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/recursiveTypeWithTwoTypeParams.txt b/compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/recursiveTypeWithTwoTypeParams.txt index 220f4c9f9b9..bbc57960bd6 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/recursiveTypeWithTwoTypeParams.txt +++ b/compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/recursiveTypeWithTwoTypeParams.txt @@ -1,6 +1,7 @@ package public fun test(/*0*/ b: BodySpec): kotlin.Unit +public fun testJava(/*0*/ b: JavaBodySpec): kotlin.Unit public interface BodySpec> { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -8,3 +9,11 @@ public interface BodySpec> { public abstract fun isEqualTo(/*0*/ expected: B): T public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + +public interface JavaBodySpec!> { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open fun isEqualTo(/*0*/ expected: B!): T! + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index df991b4936f..ffee2c02957 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -14175,6 +14175,72 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag public void testTwoTypeConstructors() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/twoTypeConstructors.kt"); } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes") + @TestDataPath("$PROJECT_ROOT") + public class SelfTypes { + @Test + public void testAllFilesPresentInSelfTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/disabledInferenceOnSelfTypes") + @TestDataPath("$PROJECT_ROOT") + public class DisabledInferenceOnSelfTypes { + @Test + public void testAllFilesPresentInDisabledInferenceOnSelfTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/disabledInferenceOnSelfTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("basicInferenceForImplicitSelfType.kt") + public void testBasicInferenceForImplicitSelfType() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/disabledInferenceOnSelfTypes/basicInferenceForImplicitSelfType.kt"); + } + + @Test + @TestMetadata("recursiveTypeWithTwoTypeParams.kt") + public void testRecursiveTypeWithTwoTypeParams() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/disabledInferenceOnSelfTypes/recursiveTypeWithTwoTypeParams.kt"); + } + + @Test + @TestMetadata("writerAppenderExampleRecursive.kt") + public void testWriterAppenderExampleRecursive() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/disabledInferenceOnSelfTypes/writerAppenderExampleRecursive.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes") + @TestDataPath("$PROJECT_ROOT") + public class EnabledInferenceOnSelfTypes { + @Test + public void testAllFilesPresentInEnabledInferenceOnSelfTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("basicInferenceForImplicitSelfType.kt") + public void testBasicInferenceForImplicitSelfType() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/basicInferenceForImplicitSelfType.kt"); + } + + @Test + @TestMetadata("recursiveTypeWithTwoTypeParams.kt") + public void testRecursiveTypeWithTwoTypeParams() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/recursiveTypeWithTwoTypeParams.kt"); + } + + @Test + @TestMetadata("writerAppenderExampleRecursive.kt") + public void testWriterAppenderExampleRecursive() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/recursiveTypes/selfTypes/enabledInferenceOnSelfTypes/writerAppenderExampleRecursive.kt"); + } + } + } } @Nested