Add examples for supertype resolve
diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java
index 21d0b77..4098aa8 100644
--- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java
+++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java
@@ -25,6 +25,88 @@
}
@Nested
+ @TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse")
+ @TestDataPath("$PROJECT_ROOT")
+ public class CompilerCourse {
+ @Test
+ @TestMetadata("01.capturedTypeParameters.kt")
+ public void test01_capturedTypeParameters() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/01.capturedTypeParameters.kt");
+ }
+
+ @Test
+ @TestMetadata("02.enumEntries.kt")
+ public void test02_enumEntries() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/02.enumEntries.kt");
+ }
+
+ @Test
+ @TestMetadata("03.whenSubjects.kt")
+ public void test03_whenSubjects() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/03.whenSubjects.kt");
+ }
+
+ @Test
+ @TestMetadata("04.ifToWhen.kt")
+ public void test04_ifToWhen() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/04.ifToWhen.kt");
+ }
+
+ @Test
+ @TestMetadata("05.forToWhile.kt")
+ public void test05_forToWhile() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/05.forToWhile.kt");
+ }
+
+ @Test
+ @TestMetadata("06.components.kt")
+ public void test06_components() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/06.components.kt");
+ }
+
+ @Test
+ @TestMetadata("07.safeCalls.kt")
+ public void test07_safeCalls() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/07.safeCalls.kt");
+ }
+
+ @Test
+ @TestMetadata("08.binaryOperators.kt")
+ public void test08_binaryOperators() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/08.binaryOperators.kt");
+ }
+
+ @Test
+ @TestMetadata("09.unaryOperators.kt")
+ public void test09_unaryOperators() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/09.unaryOperators.kt");
+ }
+
+ @Test
+ @TestMetadata("10.arrayAccess.kt")
+ public void test10_arrayAccess() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/10.arrayAccess.kt");
+ }
+
+ @Test
+ @TestMetadata("11.labels.kt")
+ public void test11_labels() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/11.labels.kt");
+ }
+
+ @Test
+ @TestMetadata("12.arrayAccessAndSafeCall.kt")
+ public void test12_arrayAccessAndSafeCall() throws Exception {
+ runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse/12.arrayAccessAndSafeCall.kt");
+ }
+
+ @Test
+ public void testAllFilesPresentInCompilerCourse() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/compilerCourse"), Pattern.compile("^(.+)\\.kt$"), null, true);
+ }
+ }
+
+ @Nested
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations")
@TestDataPath("$PROJECT_ROOT")
public class Declarations {
diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java
index 88c1661..ba4092a 100644
--- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java
+++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java
@@ -1511,6 +1511,68 @@
}
@Nested
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse")
+ @TestDataPath("$PROJECT_ROOT")
+ public class CompilerCourse {
+ @Test
+ public void testAllFilesPresentInCompilerCourse() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+
+ @Nested
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes")
+ @TestDataPath("$PROJECT_ROOT")
+ public class Supertypes {
+ @Test
+ @TestMetadata("01_simple.kt")
+ public void test01_simple() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt");
+ }
+
+ @Test
+ @TestMetadata("02_multipleFiles.kt")
+ public void test02_multipleFiles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt");
+ }
+
+ @Test
+ @TestMetadata("03_nestedClasses.kt")
+ public void test03_nestedClasses() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt");
+ }
+
+ @Test
+ @TestMetadata("04_nestedAndTopLevel.kt")
+ public void test04_nestedAndTopLevel() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt");
+ }
+
+ @Test
+ @TestMetadata("05_generics.kt")
+ public void test05_generics() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt");
+ }
+
+ @Test
+ @TestMetadata("06_jumps.kt")
+ public void test06_jumps() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt");
+ }
+
+ @Test
+ @TestMetadata("07_cycles.kt")
+ public void test07_cycles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt");
+ }
+
+ @Test
+ public void testAllFilesPresentInSupertypes() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+ }
+ }
+
+ @Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/constVal")
@TestDataPath("$PROJECT_ROOT")
public class ConstVal {
diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
index 07cbd6b..78c0acd 100644
--- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
+++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
@@ -1303,6 +1303,67 @@
}
}
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse")
+ @TestDataPath("$PROJECT_ROOT")
+ @RunWith(JUnit3RunnerWithInners.class)
+ public static class CompilerCourse extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest {
+ private void runTest(String testDataFilePath) throws Exception {
+ KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
+ }
+
+ public void testAllFilesPresentInCompilerCourse() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes")
+ @TestDataPath("$PROJECT_ROOT")
+ @RunWith(JUnit3RunnerWithInners.class)
+ public static class Supertypes extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest {
+ private void runTest(String testDataFilePath) throws Exception {
+ KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
+ }
+
+ @TestMetadata("01_simple.kt")
+ public void test01_simple() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt");
+ }
+
+ @TestMetadata("02_multipleFiles.kt")
+ public void test02_multipleFiles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt");
+ }
+
+ @TestMetadata("03_nestedClasses.kt")
+ public void test03_nestedClasses() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt");
+ }
+
+ @TestMetadata("04_nestedAndTopLevel.kt")
+ public void test04_nestedAndTopLevel() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt");
+ }
+
+ @TestMetadata("05_generics.kt")
+ public void test05_generics() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt");
+ }
+
+ @TestMetadata("06_jumps.kt")
+ public void test06_jumps() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt");
+ }
+
+ @TestMetadata("07_cycles.kt")
+ public void test07_cycles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt");
+ }
+
+ public void testAllFilesPresentInSupertypes() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+ }
+ }
+
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/constVal")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.fir.txt
new file mode 100644
index 0000000..d3d6743
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.fir.txt
@@ -0,0 +1,7 @@
+FILE: 01_simple.kt
+ public abstract interface A : R|kotlin/Any| {
+ }
+ public abstract interface B : R|kotlin/Any| {
+ }
+ public abstract interface C : R|A|, R|B| {
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt
new file mode 100644
index 0000000..77d342b
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt
@@ -0,0 +1,18 @@
+package foo
+
+interface A {
+ fun foo()
+}
+interface B
+
+// A: FirUserTypeRef("A")
+// FirResolvedTypeRef(
+// type = ConeClassType(
+// classId = foo.A,
+// typeArguments = []
+// )
+// )
+
+class C : A, B
+
+val x: A = C()
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.fir.txt
new file mode 100644
index 0000000..8c111f3
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.fir.txt
@@ -0,0 +1,15 @@
+FILE: A.kt
+ package foo
+
+ public abstract interface A : R|kotlin/Any| {
+ }
+FILE: B.kt
+ package bar
+
+ public abstract interface B : R|kotlin/Any| {
+ }
+FILE: C.kt
+ package foo
+
+ public abstract interface C : R|foo/A|, <ERROR TYPE REF: Symbol not found for B> {
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt
new file mode 100644
index 0000000..e7ff68f
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt
@@ -0,0 +1,16 @@
+// FILE: A.kt
+package foo
+
+interface A
+
+// FILE: B.kt
+package bar
+
+interface B
+
+// FILE: C.kt
+package foo
+
+interface C : A, B {
+ interface Nested
+}
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.fir.txt
new file mode 100644
index 0000000..06b23d6
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.fir.txt
@@ -0,0 +1,101 @@
+FILE: example1.kt
+ package foo
+
+ public open class Base : R|kotlin/Any| {
+ public constructor(): R|foo/Base| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class Nested : R|kotlin/Any| {
+ public constructor(): R|foo/Base.Nested| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ }
+ public final class Derived : R|foo/Base| {
+ public constructor(): R|foo/Derived| {
+ super<R|foo/Base|>()
+ }
+
+ public final class NestedInDerived : R|foo/Base.Nested| {
+ public constructor(): R|foo/Derived.NestedInDerived| {
+ super<R|foo/Base.Nested|>()
+ }
+
+ }
+
+ }
+FILE: example2.kt
+ package bar
+
+ public open class Base : R|kotlin/Any| {
+ public constructor(): R|bar/Base| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class Nested : R|kotlin/Any| {
+ public constructor(): R|bar/Base.Nested| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ }
+ public final class Derived : R|bar/Base| {
+ public constructor(): R|bar/Derived| {
+ super<R|bar/Base|>()
+ }
+
+ public final class Nested : <ERROR TYPE REF: Loop in supertype: bar/Derived.Nested -> bar/Derived.Nested> {
+ public constructor(): R|bar/Derived.Nested| {
+ super<R|bar/Derived.Nested|>()
+ }
+
+ }
+
+ }
+FILE: example3.kt
+ package baz
+
+ public open class Base : R|kotlin/Any| {
+ public constructor(): R|baz/Base| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class Nested : R|kotlin/Any| {
+ public constructor(): R|baz/Base.Nested| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ public final companion object Companion : R|kotlin/Any| {
+ private constructor(): R|baz/Base.Companion| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class Nested : R|kotlin/Any| {
+ public constructor(): R|baz/Base.Companion.Nested| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ }
+
+ }
+ public final class Derived : R|baz/Base| {
+ public constructor(): R|baz/Derived| {
+ super<R|baz/Base|>()
+ }
+
+ public final class NestedInDerived : R|baz/Base.Nested| {
+ public constructor(): R|baz/Derived.NestedInDerived| {
+ super<R|baz/Base.Nested|>()
+ }
+
+ }
+
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt
new file mode 100644
index 0000000..ec11407
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt
@@ -0,0 +1,52 @@
+// FILE: example1.kt
+package foo
+
+open class Base {
+ open class Nested
+}
+
+class Derived : Base() {
+ class NestedInDerived : Nested()
+}
+
+// FILE: example2.kt
+package bar
+
+open class Base {
+ open class Nested
+}
+
+class Derived : Base() {
+ open class A
+ class B : A()
+
+ class Nested : Nested()
+}
+
+// FILE: example3.kt
+
+package baz
+
+open class Base {
+ open class Nested // (1)
+
+ companion object {
+ open class Nested // (2)
+ }
+}
+
+class Derived : Base() {
+ class NestedInDerived : Base.Nested()
+}
+
+
+class A {
+ val x = 10
+
+ fun foo() {
+ val x = "hello"
+
+ x
+ this.x
+ }
+}
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.fir.txt
new file mode 100644
index 0000000..b86d685
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.fir.txt
@@ -0,0 +1,25 @@
+FILE: 04_nestedAndTopLevel.kt
+ public abstract interface A : R|kotlin/Any| {
+ }
+ public open class Base : R|kotlin/Any| {
+ public constructor(): R|Base| {
+ super<R|kotlin/Any|>()
+ }
+
+ public abstract interface A : R|kotlin/Any| {
+ }
+
+ }
+ public final class Derived : R|Base|, R|A| {
+ public constructor(): R|Derived| {
+ super<R|Base|>()
+ }
+
+ public final class Nested : R|Base.A| {
+ public constructor(): R|Derived.Nested| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt
new file mode 100644
index 0000000..7115fe0
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt
@@ -0,0 +1,9 @@
+interface A
+
+open class Base {
+ interface A
+}
+
+class Derived : Base(), A {
+ class Nested : A
+}
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.fir.txt
new file mode 100644
index 0000000..9bd1d70
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.fir.txt
@@ -0,0 +1,41 @@
+FILE: 05_generics.kt
+ public open class Base<T> : R|kotlin/Any| {
+ public constructor<T>(): R|Base<T>| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class Nested<K> : R|kotlin/Any| {
+ public constructor<K>(): R|Base.Nested<K>| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ public open inner class Inner<U, T> : R|kotlin/Any| {
+ public Base<T>.constructor<U>(): R|Base.Inner<U, T>| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ }
+ public final class Derived : R|Base<kotlin/String>| {
+ public constructor(): R|Derived| {
+ super<R|Base<kotlin/String>|>()
+ }
+
+ public final class DerivedNested : R|Base.Nested<kotlin/Int>| {
+ public constructor(): R|Derived.DerivedNested| {
+ super<R|Base.Nested<kotlin/Int>|>()
+ }
+
+ }
+
+ public final inner class DerivedInner : R|Base.Inner<kotlin/Long, kotlin/String>| {
+ public Derived.constructor(): R|Derived.DerivedInner| {
+ this@R|/Derived|.super<R|Base.Inner<kotlin/Long, kotlin/String>|>()
+ }
+
+ }
+
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt
new file mode 100644
index 0000000..574030a
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt
@@ -0,0 +1,24 @@
+open class Base<T> {
+ open class Nested<K> // K
+
+ open inner class Inner<U> // T, U
+}
+
+class Derived : Base<String>() {
+ class DerivedNested : Nested<Int>() // Base.Nested<Int>
+ // for name Nested
+ //
+ // symbol: Base.Nested<K>
+ // subtitution from scope: {}
+ // subtitution from arguments: K -> Int
+ // result type: Base.Nested<Int>
+
+
+ inner class DerivedInner : Inner<Long>() // Base<String>.Inner<Long>
+ // for name Inner
+ //
+ // symbol: Base<T>.Inner<U>
+ // subtitution from scope: T -> String
+ // subtitution from arguments: U -> Long
+ // result type: Base<String>.Inner<Long>
+}
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.fir.txt
new file mode 100644
index 0000000..001e91b7
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.fir.txt
@@ -0,0 +1,49 @@
+FILE: 1.kt
+ public open class C : R|Some.B| {
+ public constructor(): R|C| {
+ super<R|Some.B|>()
+ }
+
+ public open class DerivedNested : R|Base.A.Nested| {
+ public constructor(): R|C.DerivedNested| {
+ super<R|Base.A.Nested|>()
+ }
+
+ }
+
+ }
+FILE: 2.kt
+ public final class Some : R|Base| {
+ public constructor(): R|Some| {
+ super<R|Base|>()
+ }
+
+ public open class B : R|Base.A| {
+ public constructor(): R|Some.B| {
+ super<R|Base.A|>()
+ }
+
+ }
+
+ }
+FILE: 3.kt
+ public open class Base : R|kotlin/Any| {
+ public constructor(): R|Base| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class A : R|kotlin/Any| {
+ public constructor(): R|Base.A| {
+ super<R|kotlin/Any|>()
+ }
+
+ public open class Nested : R|kotlin/Any| {
+ public constructor(): R|Base.A.Nested| {
+ super<R|kotlin/Any|>()
+ }
+
+ }
+
+ }
+
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt
new file mode 100644
index 0000000..b6a59de
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt
@@ -0,0 +1,19 @@
+// FILE: 1.kt
+open class C : Some.B() {
+ open class DerivedNested : Nested()
+}
+
+// FILE: 2.kt
+class Some : Base() {
+ open class B : A()
+}
+
+interface Foo
+interface Bar
+
+// FILE: 3.kt
+open class Base {
+ open class A {
+ open class Nested
+ }
+}
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.fir.txt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.fir.txt
new file mode 100644
index 0000000..31239a6
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.fir.txt
@@ -0,0 +1,7 @@
+FILE: 07_cycles.kt
+ public abstract interface A : <ERROR TYPE REF: Loop in supertype: /A -> /B> {
+ }
+ public abstract interface B : <ERROR TYPE REF: Loop in supertype: /B -> /C> {
+ }
+ public abstract interface C : <ERROR TYPE REF: Loop in supertype: /C -> /A> {
+ }
diff --git a/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt
new file mode 100644
index 0000000..6281e7e
--- /dev/null
+++ b/compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt
@@ -0,0 +1,3 @@
+interface A : B
+interface B : C
+interface C : A
diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java
index 7058981..f668738 100644
--- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java
+++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeDiagnosticsTestGenerated.java
@@ -1511,6 +1511,68 @@
}
@Nested
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse")
+ @TestDataPath("$PROJECT_ROOT")
+ public class CompilerCourse {
+ @Test
+ public void testAllFilesPresentInCompilerCourse() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+
+ @Nested
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes")
+ @TestDataPath("$PROJECT_ROOT")
+ public class Supertypes {
+ @Test
+ @TestMetadata("01_simple.kt")
+ public void test01_simple() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt");
+ }
+
+ @Test
+ @TestMetadata("02_multipleFiles.kt")
+ public void test02_multipleFiles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt");
+ }
+
+ @Test
+ @TestMetadata("03_nestedClasses.kt")
+ public void test03_nestedClasses() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt");
+ }
+
+ @Test
+ @TestMetadata("04_nestedAndTopLevel.kt")
+ public void test04_nestedAndTopLevel() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt");
+ }
+
+ @Test
+ @TestMetadata("05_generics.kt")
+ public void test05_generics() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt");
+ }
+
+ @Test
+ @TestMetadata("06_jumps.kt")
+ public void test06_jumps() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt");
+ }
+
+ @Test
+ @TestMetadata("07_cycles.kt")
+ public void test07_cycles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt");
+ }
+
+ @Test
+ public void testAllFilesPresentInSupertypes() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+ }
+ }
+
+ @Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/constVal")
@TestDataPath("$PROJECT_ROOT")
public class ConstVal {
diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java
index fe5a1a0..73279ae 100644
--- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java
+++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiDiagnosticTestGenerated.java
@@ -1511,6 +1511,68 @@
}
@Nested
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse")
+ @TestDataPath("$PROJECT_ROOT")
+ public class CompilerCourse {
+ @Test
+ public void testAllFilesPresentInCompilerCourse() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+
+ @Nested
+ @TestMetadata("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes")
+ @TestDataPath("$PROJECT_ROOT")
+ public class Supertypes {
+ @Test
+ @TestMetadata("01_simple.kt")
+ public void test01_simple() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/01_simple.kt");
+ }
+
+ @Test
+ @TestMetadata("02_multipleFiles.kt")
+ public void test02_multipleFiles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/02_multipleFiles.kt");
+ }
+
+ @Test
+ @TestMetadata("03_nestedClasses.kt")
+ public void test03_nestedClasses() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/03_nestedClasses.kt");
+ }
+
+ @Test
+ @TestMetadata("04_nestedAndTopLevel.kt")
+ public void test04_nestedAndTopLevel() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/04_nestedAndTopLevel.kt");
+ }
+
+ @Test
+ @TestMetadata("05_generics.kt")
+ public void test05_generics() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/05_generics.kt");
+ }
+
+ @Test
+ @TestMetadata("06_jumps.kt")
+ public void test06_jumps() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/06_jumps.kt");
+ }
+
+ @Test
+ @TestMetadata("07_cycles.kt")
+ public void test07_cycles() throws Exception {
+ runTest("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes/07_cycles.kt");
+ }
+
+ @Test
+ public void testAllFilesPresentInSupertypes() throws Exception {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/compilerCourse/supertypes"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
+ }
+ }
+ }
+
+ @Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/constVal")
@TestDataPath("$PROJECT_ROOT")
public class ConstVal {