diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.fir.txt index 87500bdd671..a74f16320f0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.fir.txt @@ -1,5 +1,5 @@ FILE: classInSupertypeForEnum.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(): R|A| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt index 10fe8fcbc68..ce9f405a8af 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt @@ -1,5 +1,5 @@ -class A +open class A interface C -enum class B : C, A(), Any() +enum class B : C, A(), Any() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt index 417164e90f4..ee40af52669 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt @@ -1,3 +1,5 @@ +// FIR_IDE_IGNORE + fun test(x: Int) {} fun test(y: Int) {} @@ -16,7 +18,7 @@ fun test(z: Int, c: Char) {} } -class B : A { +class B : A { override fun rest(s: String) {} fun rest(s: String) {} diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.fir.txt index 9db508e926f..d4e005d8274 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.fir.txt @@ -125,7 +125,7 @@ FILE: cyclicConstructorDelegationCall.kt } } - public final class M : R|kotlin/Any| { + public open class M : R|kotlin/Any| { public constructor(m: R|kotlin/Int|): R|M| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt index b0386efbaf0..f4b2ad28d7b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt @@ -58,7 +58,7 @@ class K(x: Int) { constructor() : this() {} } -class M { +open class M { constructor(m: Int) } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt index 9c39bfa07c9..a00290c6504 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt @@ -1,5 +1,5 @@ FILE: delegationInInterface.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(): R|A| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt index cd5318b99c4..b9bcdd74d4c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt @@ -1,4 +1,4 @@ -class A +open class A interface B : A by a { val a: A diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.fir.txt index a34ea3e3ac5..4d82ac2c95e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.fir.txt @@ -1,5 +1,5 @@ FILE: explicitDelegationCallRequired.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(x: R|kotlin/Int|): R|A| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt index a78d7ed62a4..1412e6668eb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt @@ -1,4 +1,4 @@ -class A(x: Int) { +open class A(x: Int) { constructor(z: String) : this(10) } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.fir.txt index ac98cfa73f7..22788fadf1a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.fir.txt @@ -1,5 +1,5 @@ FILE: interfaceWithSuperclass.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(): R|A| { super() } @@ -9,7 +9,7 @@ FILE: interfaceWithSuperclass.kt } public abstract interface C : R|kotlin/Any| { } - public final class D : R|kotlin/Any| { + public open class D : R|kotlin/Any| { public constructor(): R|D| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt index 8142f7c3420..aafc49de6de 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt @@ -1,8 +1,8 @@ -class A +open class A interface B : A() interface C -class D +open class D -interface E : A(), C, D() +interface E : A(), C, D() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.fir.txt index 13bf31a9e9e..8a2c1d6414b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.fir.txt @@ -1,5 +1,5 @@ FILE: notASupertype.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(): R|A| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt index 228db84d95d..a30ba429c4a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt @@ -1,4 +1,4 @@ -class A { +open class A { fun f() {} } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt index 61185630aaa..722d2e4dfbf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt @@ -1,3 +1,5 @@ +// FIR_IDE_IGNORE + sealed class A class B : A() @@ -6,7 +8,7 @@ interface C : A interface D : C, A -class E : B, A() +class E : B, A() sealed class P { object H: P() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.fir.txt index 44ce6f49b1a..8427108852a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.fir.txt @@ -1,5 +1,5 @@ FILE: superIsNotAnExpression.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(): R|A| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt index 9eb0c508944..b462ed85bc7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt @@ -1,4 +1,4 @@ -class A +open class A class B: A() { fun act() { diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.fir.txt index 9828e957450..7cb8016475b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.fir.txt @@ -3,7 +3,7 @@ FILE: supertypeInitializedInInterface.kt } public abstract interface B : R|A| { } - public final class C : R|kotlin/Any| { + public open class C : R|kotlin/Any| { public constructor(): R|C| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt index 2b50b9f867d..c2f3e30e6e0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt @@ -2,12 +2,12 @@ interface A interface B : A() -class C +open class C interface D : C() interface E : Any() -interface F : A, B(), C, D(), Any() { +interface F : A, B(), C, D(), Any() { } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.fir.txt index 9792e605f87..596b9f4e4f9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.fir.txt @@ -1,5 +1,5 @@ FILE: supertypeInitializedWithoutPrimaryConstructor.kt - public final class A : R|kotlin/Any| { + public open class A : R|kotlin/Any| { public constructor(): R|A| { super() } @@ -11,7 +11,7 @@ FILE: supertypeInitializedWithoutPrimaryConstructor.kt } } - public final class C : R|kotlin/Any| { + public open class C : R|kotlin/Any| { public constructor(x: R|kotlin/Int|): R|C| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt index 1924d441068..6eb46ff8fb9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt @@ -1,7 +1,7 @@ -class A +open class A class B : A -class C(x: Int) +open class C(x: Int) class D : C class E : C(10) class F() : C(10) diff --git a/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.fir.txt b/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.fir.txt index 6a3d5f6c834..48abc735105 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.fir.txt @@ -1,17 +1,17 @@ FILE: fakeRecursiveSupertype.kt - public final class My : /My> { + public open class My : /My> { public constructor(): R|My| { super() } } - public final class Your : R|His| { + public open class Your : R|His| { public constructor(): R|Your| { super() } } - public final class His : /Your> { + public open class His : /Your> { public constructor(): R|His| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt index 564a212f32f..9f1625d00b5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt @@ -1,7 +1,7 @@ import incorrect.directory.My -class My : My() +open class My : My() -class Your : His() +open class Your : His() -class His : Your() +open class His : Your() diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.fir.txt b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.fir.txt index 0ef94536121..5a018e60276 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.fir.txt @@ -1,5 +1,5 @@ FILE: supertypeGenericsComplex.kt - public final class Out : R|kotlin/Any| { + public open class Out : R|kotlin/Any| { public constructor(): R|Out| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt index b8d49b08dc4..9665fdf2a82 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt @@ -1,4 +1,4 @@ -class Out +open class Out interface X : Out diff --git a/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.fir.txt b/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.fir.txt index 2f3d3dbf770..992afcecc9c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.fir.txt @@ -7,12 +7,12 @@ FILE: Test.kt } public final fun listOf(): R|kotlin/collections/List| { } - public final class LightMember : R|Member|, R|Light| { + public open class LightMember : R|Member|, R|Light| { public constructor(): R|LightMember| { super() } - public final override fun getName(): R|kotlin/String| { + public open override fun getName(): R|kotlin/String| { ^getName String(Light) } diff --git a/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt b/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt index 45f222974e2..faf0d3f2565 100644 --- a/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt +++ b/compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt @@ -35,7 +35,7 @@ fun List.single(): Int = 2 fun listOf(): List {} -public class LightMember : Member, Light() { +public open class LightMember : Member, Light() { override fun getName(): String = "Light" } diff --git a/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt index 8c7e5def17d..45d9f084fe0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt @@ -28,7 +28,7 @@ private class C { } } -class D : A { +class D : A { class Test1 : A.AProtectedI { } @@ -38,11 +38,11 @@ interface E { } -class Test2 : A.APublicI, B.BInner() { +class Test2 : A.APublicI, B.BInner() { } -class Test3 : C.CPublicI, C { +class Test3 : C.CPublicI, C { } @@ -50,11 +50,11 @@ class Test4 : E, A.AProtectedI { } -class Test5 : C.CPublicI, B.BInner() { +class Test5 : C.CPublicI, B.BInner() { } -class Test6 : E, C.CPublic { +class Test6 : E, C.CPublic { } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.fir.txt index 46b2cdede09..4c3ffb3d1ef 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.fir.txt @@ -19,7 +19,7 @@ FILE: common.kt } Module: m1-jvm FILE: jvm.kt - public final actual class MyList : R|kotlin/Any| { + public open actual class MyList : R|kotlin/Any| { public constructor(): R|MyList| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.kt index 3d197588ea6..d4b1d2f8b0c 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.kt @@ -11,7 +11,7 @@ open class Wrapper(val list: MyList) // MODULE: m1-jvm(m1-common) // FILE: jvm.kt -actual class MyList { +actual open class MyList { actual fun get(i: Int): Int = i fun set(i: Int, v: Int) {} diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.fir.txt index 71f780c9ba1..9ecaa638176 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.fir.txt @@ -38,7 +38,7 @@ FILE: problems.kt public get(): R|kotlin/String| public final val p: R|kotlin/Pair| = R|kotlin/Pair.Pair|(Int(0), String()) public get(): R|kotlin/Pair| - public final class Base : R|kotlin/Any| { + public open class Base : R|kotlin/Any| { public constructor(x: R|T|): R|Base| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.kt index 49296c70021..c9b730ba127 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.kt @@ -17,7 +17,7 @@ val String.bar get() = "987" val p = Pair(0, "") -class Base(val x: T) +open class Base(val x: T) class Derived : Base(10) val xx = Derived().x + 1 diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt index ad213f6fa80..93812060e61 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt @@ -69,6 +69,7 @@ enum class PositioningStrategy(private val strategy: String? = null) { SUSPEND_MODIFIER, FUN_INTERFACE, RESERVED_UNDERSCORE, + QUESTION_MARK_BY_TYPE, ; diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index 66fbd6faa83..9aedba147a0 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -100,17 +100,24 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val RECURSION_IN_SUPERTYPES by error() val NOT_A_SUPERTYPE by error() val SUPERCLASS_NOT_ACCESSIBLE_FROM_INTERFACE by error() - val QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE by error { + val QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE by error { parameter>("otherSuperType") } - val SUPERTYPE_INITIALIZED_IN_INTERFACE by error() - val INTERFACE_WITH_SUPERCLASS by error() - val CLASS_IN_SUPERTYPE_FOR_ENUM by error() - val SEALED_SUPERTYPE by error() - val SEALED_SUPERTYPE_IN_LOCAL_CLASS by error() + val SUPERTYPE_INITIALIZED_IN_INTERFACE by error() + val INTERFACE_WITH_SUPERCLASS by error() + val FINAL_SUPERTYPE by error() + val SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE by error() + val SINGLETON_IN_SUPERTYPE by error() + val NULLABLE_SUPERTYPE by error(PositioningStrategy.QUESTION_MARK_BY_TYPE) + val MANY_CLASSES_IN_SUPERTYPE_LIST by error() + val SUPERTYPE_APPEARS_TWICE by error() + val CLASS_IN_SUPERTYPE_FOR_ENUM by error() + val SEALED_SUPERTYPE by error() + val SEALED_SUPERTYPE_IN_LOCAL_CLASS by error() val SUPERTYPE_NOT_A_CLASS_OR_INTERFACE by error { parameter("reason") } + } val CONSTRUCTOR_PROBLEMS by object : DiagnosticGroup("Constructor problems") { diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 54f11de9fa9..c93138933a8 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -120,12 +120,18 @@ object FirErrors { val RECURSION_IN_SUPERTYPES by error0() val NOT_A_SUPERTYPE by error0() val SUPERCLASS_NOT_ACCESSIBLE_FROM_INTERFACE by error0() - val QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE by error1>() - val SUPERTYPE_INITIALIZED_IN_INTERFACE by error0() - val INTERFACE_WITH_SUPERCLASS by error0() - val CLASS_IN_SUPERTYPE_FOR_ENUM by error0() - val SEALED_SUPERTYPE by error0() - val SEALED_SUPERTYPE_IN_LOCAL_CLASS by error0() + val QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE by error1>() + val SUPERTYPE_INITIALIZED_IN_INTERFACE by error0() + val INTERFACE_WITH_SUPERCLASS by error0() + val FINAL_SUPERTYPE by error0() + val SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE by error0() + val SINGLETON_IN_SUPERTYPE by error0() + val NULLABLE_SUPERTYPE by error0(SourceElementPositioningStrategies.QUESTION_MARK_BY_TYPE) + val MANY_CLASSES_IN_SUPERTYPE_LIST by error0() + val SUPERTYPE_APPEARS_TWICE by error0() + val CLASS_IN_SUPERTYPE_FOR_ENUM by error0() + val SEALED_SUPERTYPE by error0() + val SEALED_SUPERTYPE_IN_LOCAL_CLASS by error0() val SUPERTYPE_NOT_A_CLASS_OR_INTERFACE by error1() // Constructor problems diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt index 78381730072..a30eb948d74 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt @@ -6,26 +6,72 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn +import org.jetbrains.kotlin.fir.analysis.diagnostics.withSuppressedDiagnostics import org.jetbrains.kotlin.fir.declarations.FirClass +import org.jetbrains.kotlin.fir.declarations.FirRegularClass +import org.jetbrains.kotlin.fir.declarations.modality import org.jetbrains.kotlin.fir.resolve.toSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.fir.types.ConeNullability import org.jetbrains.kotlin.fir.types.coneType +import org.jetbrains.kotlin.fir.types.isExtensionFunctionType import org.jetbrains.kotlin.utils.addToStdlib.safeAs object FirSupertypesChecker : FirClassChecker() { override fun check(declaration: FirClass<*>, context: CheckerContext, reporter: DiagnosticReporter) { val isInterface = declaration.classKind == ClassKind.INTERFACE + var nullableSupertypeReported = false + var extensionFunctionSupertypeReported = false + var interfaceWithSuperclassReported = !isInterface + var finalSupertypeReported = false + var singletonInSupertypeReported = false + var classAppeared = false + val superClassSymbols = hashSetOf() for (superTypeRef in declaration.superTypeRefs) { - val lookupTag = superTypeRef.coneType.safeAs()?.lookupTag ?: continue - val superTypeFir = lookupTag.toSymbol(context.session)?.fir + withSuppressedDiagnostics(superTypeRef, context) { + val coneType = superTypeRef.coneType + if (!nullableSupertypeReported && coneType.nullability == ConeNullability.NULLABLE) { + reporter.reportOn(superTypeRef.source, FirErrors.NULLABLE_SUPERTYPE, context) + nullableSupertypeReported = true + } + if (!extensionFunctionSupertypeReported && coneType.isExtensionFunctionType) { + reporter.reportOn(superTypeRef.source, FirErrors.SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE, context) + extensionFunctionSupertypeReported = true + } + val lookupTag = coneType.safeAs()?.lookupTag ?: return@withSuppressedDiagnostics + val superTypeFir = lookupTag.toSymbol(context.session)?.fir - if (isInterface && superTypeFir is FirClass<*> && superTypeFir.classKind != ClassKind.INTERFACE) { - reporter.reportOn(superTypeRef.source, FirErrors.INTERFACE_WITH_SUPERCLASS, context) - return + if (superTypeFir is FirRegularClass) { + if (!superClassSymbols.add(superTypeFir.symbol)) { + reporter.reportOn(superTypeRef.source, FirErrors.SUPERTYPE_APPEARS_TWICE, context) + } + if (superTypeFir.classKind != ClassKind.INTERFACE) { + if (classAppeared) { + reporter.reportOn(superTypeRef.source, FirErrors.MANY_CLASSES_IN_SUPERTYPE_LIST, context) + } else { + classAppeared = true + } + if (!interfaceWithSuperclassReported) { + reporter.reportOn(superTypeRef.source, FirErrors.INTERFACE_WITH_SUPERCLASS, context) + interfaceWithSuperclassReported = true + } + } + val isObject = superTypeFir.classKind == ClassKind.OBJECT + if (!finalSupertypeReported && !isObject && superTypeFir.modality == Modality.FINAL) { + reporter.reportOn(superTypeRef.source, FirErrors.FINAL_SUPERTYPE, context) + finalSupertypeReported = true + } + if (!singletonInSupertypeReported && isObject) { + reporter.reportOn(superTypeRef.source, FirErrors.SINGLETON_IN_SUPERTYPE, context) + singletonInSupertypeReported = true + } + } } } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 83ddb364001..c0b9ee2a484 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -120,6 +120,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPRESSION_OF_NUL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXTENSION_PROPERTY_WITH_BACKING_FIELD +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FINAL_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FINAL_UPPER_BOUND import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FORBIDDEN_VARARG_PARAMETER_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FUN_INTERFACE_CONSTRUCTOR_REFERENCE @@ -166,6 +167,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LEAKED_IN_PLACE_L import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LOCAL_ANNOTATION_CLASS_ERROR import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LOCAL_INTERFACE_NOT_ALLOWED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LOCAL_OBJECT_NOT_ALLOWED +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.MANY_CLASSES_IN_SUPERTYPE_LIST import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.MANY_COMPANION_OBJECTS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.MANY_IMPL_MEMBER_NOT_IMPLEMENTED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED @@ -204,6 +206,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NO_GET_METHOD import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NO_SET_METHOD import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NO_THIS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NO_VALUE_FOR_PARAMETER +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NULLABLE_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NULLABLE_TYPE_IN_CLASS_LITERAL_LHS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NULLABLE_TYPE_OF_ANNOTATION_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ONLY_ONE_CLASS_BOUND_ALLOWED @@ -254,10 +257,13 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SEALED_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SEALED_SUPERTYPE_IN_LOCAL_CLASS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SINGLETON_IN_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERCLASS_NOT_ACCESSIBLE_FROM_INTERFACE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPES_FOR_ANNOTATION_CLASS +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPE_APPEARS_TWICE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPE_INITIALIZED_IN_INTERFACE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPE_NOT_A_CLASS_OR_INTERFACE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPERTYPE_NOT_INITIALIZED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPER_CALL_FROM_PUBLIC_INLINE @@ -391,6 +397,12 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { ) map.put(SUPERTYPE_INITIALIZED_IN_INTERFACE, "Interfaces cannot initialize supertypes") map.put(INTERFACE_WITH_SUPERCLASS, "An interface cannot inherit from a class") + map.put(FINAL_SUPERTYPE, "This type is final, so it cannot be inherited from") + map.put(SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE, "Extension function type is not allowed as supertypes") + map.put(SINGLETON_IN_SUPERTYPE, "Cannot inherit from a singleton") + map.put(NULLABLE_SUPERTYPE, "A supertype cannot be nullable") + map.put(MANY_CLASSES_IN_SUPERTYPE_LIST, "Only one class may appear in a supertype list") + map.put(SUPERTYPE_APPEARS_TWICE, "A supertype appears twice") map.put(CLASS_IN_SUPERTYPE_FOR_ENUM, "Enum class cannot inherit from classes") map.put(SEALED_SUPERTYPE, "This type is sealed, so it can be inherited by only its own nested classes or objects") map.put(SEALED_SUPERTYPE_IN_LOCAL_CLASS, "Local class cannot extend a sealed class") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index c2b7e705e2e..71e8a70700d 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -687,6 +687,26 @@ object LightTreePositioningStrategies { return super.mark(node, startOffset, endOffset, tree) } } + + val QUESTION_MARK_BY_TYPE: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + if (node.tokenType == KtNodeTypes.TYPE_REFERENCE) { + val typeElement = tree.findChildByType(node, KtNodeTypes.NULLABLE_TYPE) + if (typeElement != null) { + val question = tree.findChildByType(typeElement, KtTokens.QUEST) + if (question != null) { + return markElement(question, startOffset, endOffset, tree, node) + } + } + } + return super.mark(node, startOffset, endOffset, tree) + } + } } fun FirSourceElement.hasValOrVar(): Boolean = diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt index a04f08242f1..1bf1639849f 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt @@ -237,4 +237,9 @@ object SourceElementPositioningStrategies { LightTreePositioningStrategies.RESERVED_UNDERSCORE, PositioningStrategies.RESERVED_UNDERSCORE ) + + val QUESTION_MARK_BY_TYPE = SourceElementPositioningStrategy( + LightTreePositioningStrategies.QUESTION_MARK_BY_TYPE, + PositioningStrategies.QUESTION_MARK_BY_TYPE + ) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index b3808b1bce3..7ec15f9614f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -590,6 +590,17 @@ object PositioningStrategies { } } + @JvmField + val QUESTION_MARK_BY_TYPE: PositioningStrategy = object : PositioningStrategy() { + override fun mark(element: KtTypeReference): List { + val typeElement = element.typeElement + if (typeElement is KtNullableType) { + return markNode(typeElement.questionMarkNode) + } + return super.mark(element) + } + } + @JvmField val CALL_EXPRESSION: PositioningStrategy = object : PositioningStrategy() { override fun mark(element: PsiElement): List { diff --git a/compiler/testData/cli/jvm/firError.out b/compiler/testData/cli/jvm/firError.out index 320e809382d..7edb302fe70 100644 --- a/compiler/testData/cli/jvm/firError.out +++ b/compiler/testData/cli/jvm/firError.out @@ -5,6 +5,9 @@ compiler/testData/cli/jvm/firError.kt:5:13: error: variable 'x' must be initiali println(x) ^ compiler/testData/cli/jvm/firError.kt:10:16: error: public subclass exposes its private-in-file supertype 'Private' +class Public : Private() { + ^ +compiler/testData/cli/jvm/firError.kt:10:16: error: this type is final, so it cannot be inherited from class Public : Private() { ^ compiler/testData/cli/jvm/firError.kt:11:5: error: property must be initialized or be abstract diff --git a/compiler/testData/diagnostics/tests/Constructors.fir.kt b/compiler/testData/diagnostics/tests/Constructors.fir.kt index 9d78865c290..599f5b66389 100644 --- a/compiler/testData/diagnostics/tests/Constructors.fir.kt +++ b/compiler/testData/diagnostics/tests/Constructors.fir.kt @@ -14,7 +14,7 @@ class WithPC1(a : Int) { } -class Foo() : WithPC0, this() { +class Foo() : WithPC0, this() { } diff --git a/compiler/testData/diagnostics/tests/ProjectionsInSupertypes.fir.kt b/compiler/testData/diagnostics/tests/ProjectionsInSupertypes.fir.kt index 2e5805d7b18..e87e1ec02e4 100644 --- a/compiler/testData/diagnostics/tests/ProjectionsInSupertypes.fir.kt +++ b/compiler/testData/diagnostics/tests/ProjectionsInSupertypes.fir.kt @@ -3,4 +3,4 @@ interface B {} interface C {} interface D {} -interface Test : A, B, C<*>???, D {} \ No newline at end of file +interface Test : A, B, C<*>???, D {} diff --git a/compiler/testData/diagnostics/tests/SupertypeListChecks.fir.kt b/compiler/testData/diagnostics/tests/SupertypeListChecks.fir.kt index 695bbaad894..88e5d08ed79 100644 --- a/compiler/testData/diagnostics/tests/SupertypeListChecks.fir.kt +++ b/compiler/testData/diagnostics/tests/SupertypeListChecks.fir.kt @@ -28,22 +28,22 @@ interface Test1 : C2 {} -interface Test3 : C2, C3 {} +interface Test3 : C2, C3 {} interface Test4 : T1 {} -interface Test5 : T1, T1 {} +interface Test5 : T1, T1 {} -interface Test6 : C1 {} +interface Test6 : C1 {} class CTest1() : OC1() {} class CTest2 : C2 {} -class CTest3 : C2, C3 {} +class CTest3 : C2, C3 {} class CTest4 : T1 {} -class CTest5 : T1, T1 {} +class CTest5 : T1, T1 {} -class CTest6 : C1 {} +class CTest6 : C1 {} diff --git a/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.fir.kt index 04d17f7f1ca..33e4b49b3dd 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.fir.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.fir.kt @@ -10,4 +10,4 @@ data class Nasty(val z: Int, val y: Int): Base(z) data class Complex(val y: Int): SuperInterface, SuperClass() -data class SubData(val sss: String) : Complex(42) +data class SubData(val sss: String) : Complex(42) diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt index d89632145d8..9aec17205bc 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt @@ -23,6 +23,6 @@ public abstract class MyClass : Base1, Base2 { } } -class A : MyClass(), Base1 by Delegate1(), Base1 by Delegate2() { +class A : MyClass(), Base1 by Delegate1(), Base1 by Delegate2() { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt b/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt index 561eb31cffd..734bc3314d7 100644 --- a/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt @@ -1,7 +1,7 @@ // FILE: test.kt enum class MyEnum(): MyClass() {} enum class MyEnum2(): MyTrait {} -enum class MyEnum3(): MyEnumBase() {} +enum class MyEnum3(): MyEnumBase() {} open class MyClass() {} diff --git a/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt b/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt index b36a5872ea8..3b560fcf630 100644 --- a/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt @@ -8,6 +8,6 @@ open enum class MyEnum() { enum class MyEnum2() {} -class MyClass(): MyEnum2() {} +class MyClass(): MyEnum2() {} -class MyClass2(): MyJavaEnum() {} +class MyClass2(): MyJavaEnum() {} diff --git a/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.fir.kt deleted file mode 100644 index 4b4b9306d5a..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: a.kt - -package foo - -object Bar { - fun bar() {} -} - -// FILE: b.kt - -package baz - -import foo.Bar - -class C: Bar - -fun test() { - Bar.bar() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.kt b/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.kt index 19c066a5156..340f7cd7b02 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportObjectAndUseAsSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package foo diff --git a/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt b/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt index c9aa814a7c4..8b3da8f5b2a 100644 --- a/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt @@ -11,4 +11,4 @@ package a import pack1.SomeClass.* -private class X : N() +private class X : N() diff --git a/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.fir.kt b/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.fir.kt index 2e168387680..82ae5349ff8 100644 --- a/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.fir.kt @@ -1,6 +1,6 @@ class Test { @`InnerAnnotation` @InnerAnnotation - companion object : StaticClass(), InnerClass() { + companion object : StaticClass(), InnerClass() { } diff --git a/compiler/testData/diagnostics/tests/inner/modality.fir.kt b/compiler/testData/diagnostics/tests/inner/modality.fir.kt index e5f9277c709..64ad3c04c72 100644 --- a/compiler/testData/diagnostics/tests/inner/modality.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/modality.fir.kt @@ -6,12 +6,12 @@ class Outer { class FinalInner class Nested1 : OpenNested() - class Nested2 : FinalNested() + class Nested2 : FinalNested() class Nested3 : OpenInner() - class Nested4 : FinalInner() + class Nested4 : FinalInner() inner class Inner1 : OpenNested() - inner class Inner2 : FinalNested() + inner class Inner2 : FinalNested() inner class Inner3 : OpenInner() - inner class Inner4 : FinalInner() + inner class Inner4 : FinalInner() } diff --git a/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.fir.kt index 6924c396747..c227badcfe7 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.fir.kt @@ -1,5 +1,5 @@ interface A -interface X: A?? { +interface X: A?? { } diff --git a/compiler/testData/diagnostics/tests/objects/Objects.fir.kt b/compiler/testData/diagnostics/tests/objects/Objects.fir.kt index 17b144fbd1f..30c1aa71943 100644 --- a/compiler/testData/diagnostics/tests/objects/Objects.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/Objects.fir.kt @@ -14,7 +14,7 @@ package toplevelObjectDeclarations } } - object B : A {} + object B : A {} val x = A.foo() diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.fir.kt b/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.fir.kt deleted file mode 100644 index 06a40bef38f..00000000000 --- a/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -package toplevelObjectDeclarations - -object CObj {} - -object DOjb : CObj {} diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.kt b/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.kt index a5511222d81..cb2b25bbd9a 100644 --- a/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.kt +++ b/compiler/testData/diagnostics/tests/objects/ObjectsInheritance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package toplevelObjectDeclarations object CObj {} diff --git a/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.fir.kt b/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.fir.kt deleted file mode 100644 index 5e5f2b41812..00000000000 --- a/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -class Foo { - open fun openFoo() {} - fun finalFoo() {} -} - -class Bar : Foo() { - override fun openFoo() {} - override fun finalFoo() {} -} - - -open class A1 { - open fun foo() {} -} - -class B1 : A1() -class C1 : B1() { - override fun foo() {} -} - -abstract class A2 { - abstract fun foo() -} - -class B2 : A2() -class C2 : B2() { - override fun foo() {} -} diff --git a/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.kt b/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.kt index b27b226aa91..ea171119f4b 100644 --- a/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.kt +++ b/compiler/testData/diagnostics/tests/override/overrideMemberFromFinalClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo { open fun openFoo() {} fun finalFoo() {} diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/companionObjectParents.fir.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/companionObjectParents.fir.kt index 4dd7a073951..52b385ddfa7 100644 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/companionObjectParents.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/classHeader/companionObjectParents.fir.kt @@ -7,7 +7,7 @@ val bImpl: B.Companion.Interface get() = null!! interface A { - companion object : Nested(), Interface by aImpl, I { + companion object : Nested(), Interface by aImpl, I { class Nested @@ -16,7 +16,7 @@ interface A { } class B { - companion object : Nested(), Interface by aImpl, I { + companion object : Nested(), Interface by aImpl, I { class Nested diff --git a/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.fir.kt b/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.fir.kt deleted file mode 100644 index 9a3efab4a69..00000000000 --- a/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -class A : Double.() -> Unit { - override fun invoke(p1: Double) {} -} - -class B : Int.(Double) -> Unit { - override fun invoke(p1: Int, p2: Double) {} -} - -open class C {} - -abstract class A0 : C.() -> Int -abstract class A1 : C.(Int) -> Int -abstract class A2 : C.(Int, String) -> Int - -open class D {} - -abstract class B0 : D.() -> Int -abstract class B1 : D.(C) -> Int -abstract class B2 : D.(T, C) -> T - -interface E {} - -abstract class C0: C(), Int.() -> Double -abstract class C1: C(), E, Int.(C) -> Double \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.kt b/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.kt index c807797923d..39639446971 100644 --- a/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.kt +++ b/compiler/testData/diagnostics/tests/subtyping/extFunctionTypeAsSuperType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A : Double.() -> Unit { override fun invoke(p1: Double) {} } diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.fir.kt b/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.fir.kt index c38b13da824..6a3facf9a42 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.fir.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.fir.kt @@ -1,10 +1,10 @@ open class bar() -interface Foo() : bar(), bar, bar { +interface Foo() : bar(), bar, bar { } interface Foo2 : bar, Foo { } -open class Foo1() : bar(), bar, Foo, Foo() {} -open class Foo12 : bar(), bar {} +open class Foo1() : bar(), bar, Foo, Foo() {} +open class Foo12 : bar(), bar {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.fir.kt index 59bfdfb2288..ae7ec219bbd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.fir.kt @@ -29,7 +29,7 @@ interface Supertype1 : suspend () -> Unit { } -interface Supertype2 : suspend String.() -> Unit { +interface Supertype2 : suspend String.() -> Unit { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/ea70485_functionTypeInheritor.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/ea70485_functionTypeInheritor.fir.kt index b2afdc72754..24db0a29c5c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/ea70485_functionTypeInheritor.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/ea70485_functionTypeInheritor.fir.kt @@ -9,7 +9,7 @@ fun test() { a {} } -class Ext : String.() -> Unit { +class Ext : String.() -> Unit { } fun test2() { diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt index 594585eba94..d209917bf08 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -308,6 +308,42 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirErrors.FINAL_SUPERTYPE) { firDiagnostic -> + FinalSupertypeImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } + add(FirErrors.SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE) { firDiagnostic -> + SupertypeIsExtensionFunctionTypeImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } + add(FirErrors.SINGLETON_IN_SUPERTYPE) { firDiagnostic -> + SingletonInSupertypeImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } + add(FirErrors.NULLABLE_SUPERTYPE) { firDiagnostic -> + NullableSupertypeImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } + add(FirErrors.MANY_CLASSES_IN_SUPERTYPE_LIST) { firDiagnostic -> + ManyClassesInSupertypeListImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } + add(FirErrors.SUPERTYPE_APPEARS_TWICE) { firDiagnostic -> + SupertypeAppearsTwiceImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } add(FirErrors.CLASS_IN_SUPERTYPE_FOR_ENUM) { firDiagnostic -> ClassInSupertypeForEnumImpl( firDiagnostic as FirPsiDiagnostic<*>, diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt index a425eacc5dd..e3ca6816c90 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt @@ -220,28 +220,52 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = SuperclassNotAccessibleFromInterface::class } - abstract class QualifiedSupertypeExtendedByOtherSupertype : KtFirDiagnostic() { + abstract class QualifiedSupertypeExtendedByOtherSupertype : KtFirDiagnostic() { override val diagnosticClass get() = QualifiedSupertypeExtendedByOtherSupertype::class abstract val otherSuperType: KtClassLikeSymbol } - abstract class SupertypeInitializedInInterface : KtFirDiagnostic() { + abstract class SupertypeInitializedInInterface : KtFirDiagnostic() { override val diagnosticClass get() = SupertypeInitializedInInterface::class } - abstract class InterfaceWithSuperclass : KtFirDiagnostic() { + abstract class InterfaceWithSuperclass : KtFirDiagnostic() { override val diagnosticClass get() = InterfaceWithSuperclass::class } - abstract class ClassInSupertypeForEnum : KtFirDiagnostic() { + abstract class FinalSupertype : KtFirDiagnostic() { + override val diagnosticClass get() = FinalSupertype::class + } + + abstract class SupertypeIsExtensionFunctionType : KtFirDiagnostic() { + override val diagnosticClass get() = SupertypeIsExtensionFunctionType::class + } + + abstract class SingletonInSupertype : KtFirDiagnostic() { + override val diagnosticClass get() = SingletonInSupertype::class + } + + abstract class NullableSupertype : KtFirDiagnostic() { + override val diagnosticClass get() = NullableSupertype::class + } + + abstract class ManyClassesInSupertypeList : KtFirDiagnostic() { + override val diagnosticClass get() = ManyClassesInSupertypeList::class + } + + abstract class SupertypeAppearsTwice : KtFirDiagnostic() { + override val diagnosticClass get() = SupertypeAppearsTwice::class + } + + abstract class ClassInSupertypeForEnum : KtFirDiagnostic() { override val diagnosticClass get() = ClassInSupertypeForEnum::class } - abstract class SealedSupertype : KtFirDiagnostic() { + abstract class SealedSupertype : KtFirDiagnostic() { override val diagnosticClass get() = SealedSupertype::class } - abstract class SealedSupertypeInLocalClass : KtFirDiagnostic() { + abstract class SealedSupertypeInLocalClass : KtFirDiagnostic() { override val diagnosticClass get() = SealedSupertypeInLocalClass::class } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index 1a733699474..80ecb9e3c67 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -339,42 +339,84 @@ internal class QualifiedSupertypeExtendedByOtherSupertypeImpl( override val otherSuperType: KtClassLikeSymbol, firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.QualifiedSupertypeExtendedByOtherSupertype(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.QualifiedSupertypeExtendedByOtherSupertype(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } internal class SupertypeInitializedInInterfaceImpl( firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.SupertypeInitializedInInterface(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.SupertypeInitializedInInterface(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } internal class InterfaceWithSuperclassImpl( firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.InterfaceWithSuperclass(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.InterfaceWithSuperclass(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + +internal class FinalSupertypeImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.FinalSupertype(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + +internal class SupertypeIsExtensionFunctionTypeImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.SupertypeIsExtensionFunctionType(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + +internal class SingletonInSupertypeImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.SingletonInSupertype(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + +internal class NullableSupertypeImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.NullableSupertype(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + +internal class ManyClassesInSupertypeListImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.ManyClassesInSupertypeList(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + +internal class SupertypeAppearsTwiceImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.SupertypeAppearsTwice(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } internal class ClassInSupertypeForEnumImpl( firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.ClassInSupertypeForEnum(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.ClassInSupertypeForEnum(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } internal class SealedSupertypeImpl( firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.SealedSupertype(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.SealedSupertype(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } internal class SealedSupertypeInLocalClassImpl( firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.SealedSupertypeInLocalClass(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.SealedSupertypeInLocalClass(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } diff --git a/idea/testData/checker/Constructors.fir.kt b/idea/testData/checker/Constructors.fir.kt index 8b6d7e843b6..caa82f21b27 100644 --- a/idea/testData/checker/Constructors.fir.kt +++ b/idea/testData/checker/Constructors.fir.kt @@ -18,7 +18,7 @@ class WithPC1(a : Int) { } -class Foo() : WithPC0(), this() { +class Foo() : WithPC0(), this() { } diff --git a/idea/testData/checker/Objects.fir.kt b/idea/testData/checker/Objects.fir.kt index 8325cc56e26..254809fdf45 100644 --- a/idea/testData/checker/Objects.fir.kt +++ b/idea/testData/checker/Objects.fir.kt @@ -13,7 +13,7 @@ package toplevelObjectDeclarations } } - object B : A {} + object B : A {} val x = A.foo() diff --git a/idea/testData/checker/ProjectionsInSupertypes.fir.kt b/idea/testData/checker/ProjectionsInSupertypes.fir.kt index c1451f00f67..bf594fc8312 100644 --- a/idea/testData/checker/ProjectionsInSupertypes.fir.kt +++ b/idea/testData/checker/ProjectionsInSupertypes.fir.kt @@ -3,4 +3,4 @@ interface B {} interface C {} interface D {} -interface Test : A, B, C<*>???, D {} +interface Test : A, B, C<*>???, D {} diff --git a/idea/testData/checker/SupertypeListChecks.fir.kt b/idea/testData/checker/SupertypeListChecks.fir.kt index 026494bc013..4d2a1f65878 100644 --- a/idea/testData/checker/SupertypeListChecks.fir.kt +++ b/idea/testData/checker/SupertypeListChecks.fir.kt @@ -28,22 +28,22 @@ interface Test1 : C2 {} -interface Test3 : C2, C3 {} +interface Test3 : C2, C3 {} interface Test4 : T1 {} -interface Test5 : T1, T1 {} +interface Test5 : T1, T1 {} -interface Test6 : C1 {} +interface Test6 : C1 {} class CTest1() : OC1() {} class CTest2 : C2 {} -class CTest3 : C2, C3 {} +class CTest3 : C2, C3 {} class CTest4 : T1 {} -class CTest5 : T1, T1 {} +class CTest5 : T1, T1 {} -class CTest6 : C1 {} +class CTest6 : C1 {} diff --git a/idea/testData/checker/TraitSupertypeList.fir.kt b/idea/testData/checker/TraitSupertypeList.fir.kt index 6e6cb0d9e9f..17fea5178bd 100644 --- a/idea/testData/checker/TraitSupertypeList.fir.kt +++ b/idea/testData/checker/TraitSupertypeList.fir.kt @@ -1,10 +1,10 @@ open class bar() -interface Foo() : bar(), bar, bar { +interface Foo() : bar(), bar, bar { } interface Foo2 : bar, Foo { } -open class Foo1() : bar(), bar, Foo, Foo() {} -open class Foo12 : bar(), bar {} +open class Foo1() : bar(), bar, Foo, Foo() {} +open class Foo12 : bar(), bar {} diff --git a/jps-plugin/testData/incremental/classHierarchyAffected/classBecameFinal/fir-build.log b/jps-plugin/testData/incremental/classHierarchyAffected/classBecameFinal/fir-build.log deleted file mode 100644 index 409d05ffbd8..00000000000 --- a/jps-plugin/testData/incremental/classHierarchyAffected/classBecameFinal/fir-build.log +++ /dev/null @@ -1,38 +0,0 @@ -================ Step #1 ================= - -Compiling files: - src/A.kt - src/AChild.kt - src/AGrandChild.kt - src/ATypeParameter.kt - src/classLiteral.kt - src/functionParameter.kt - src/getA.kt - src/importA.kt - src/importAGrandChild.kt - src/importStar.kt - src/referencedByFqName.kt - src/returnType.kt - src/returnTypeImplicit.kt -End of files -Exit code: OK - -================ Step #2 ================= - -Compiling files: - src/A.kt - src/AChild.kt - src/AGrandChild.kt - src/ATypeParameter.kt - src/classLiteral.kt - src/functionParameter.kt - src/getA.kt - src/importA.kt - src/importAGrandChild.kt - src/importStar.kt - src/referencedByFqName.kt - src/returnType.kt - src/returnTypeImplicit.kt -End of files -Exit code: OK -