diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt index e0a7b880008..26a9204bead 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirNotImplementedOverrideChecker.kt @@ -37,7 +37,7 @@ object FirNotImplementedOverrideChecker : FirClassChecker() { val sourceKind = source.kind if (sourceKind is FirFakeSourceElementKind && sourceKind != FirFakeSourceElementKind.EnumInitializer) return val modality = declaration.modality() - if (modality == Modality.ABSTRACT || modality == Modality.SEALED) return + val canHaveAbstractDeclarations = modality == Modality.ABSTRACT || modality == Modality.SEALED if (declaration is FirRegularClass && declaration.isExpect) return val classKind = declaration.classKind if (classKind == ClassKind.ANNOTATION_CLASS || classKind == ClassKind.ENUM_CLASS) return @@ -67,7 +67,7 @@ object FirNotImplementedOverrideChecker : FirClassChecker() { classScope.processPropertiesByName(name, ::collectSymbol) } - if (notImplementedSymbols.isNotEmpty()) { + if (!canHaveAbstractDeclarations && notImplementedSymbols.isNotEmpty()) { val notImplemented = notImplementedSymbols.first().unwrapFakeOverrides().fir if (notImplemented.isFromInterfaceOrEnum(context)) { reporter.reportOn(source, ABSTRACT_MEMBER_NOT_IMPLEMENTED, declaration, notImplemented, context) @@ -75,7 +75,7 @@ object FirNotImplementedOverrideChecker : FirClassChecker() { reporter.reportOn(source, ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED, declaration, notImplemented, context) } } - if (invisibleSymbols.isNotEmpty()) { + if (!canHaveAbstractDeclarations && invisibleSymbols.isNotEmpty()) { val invisible = invisibleSymbols.first().fir if (context.session.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitInvisibleAbstractMethodsInSuperclasses)) { reporter.reportOn(source, INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER, declaration, invisible, context) diff --git a/compiler/testData/diagnostics/tests/declarationChecks/sealedOnMembers.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/sealedOnMembers.fir.kt index fd7e97ebe76..c9061508727 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/sealedOnMembers.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/sealedOnMembers.fir.kt @@ -8,7 +8,7 @@ interface B { abstract var bar: Unit } -interface C : A, B +interface C : A, B abstract class D(sealed var x: Int) { abstract var y: Unit diff --git a/compiler/testData/diagnostics/tests/delegation/clashes/propertyTypeMismatch.fir.kt b/compiler/testData/diagnostics/tests/delegation/clashes/propertyTypeMismatch.fir.kt index 023163cdfec..27c3b9c6d03 100644 --- a/compiler/testData/diagnostics/tests/delegation/clashes/propertyTypeMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/delegation/clashes/propertyTypeMismatch.fir.kt @@ -34,7 +34,7 @@ abstract class Test1 : IStr by CStr(), IInt abstract class Test2 : IStr, IInt by CInt() -abstract class Test3 : IStr by CStr(), IInt by CInt() +abstract class Test3 : IStr by CStr(), IInt by CInt() abstract class Test4 : IStr by CStr(), IGeneric @@ -49,9 +49,9 @@ abstract class Test8 : IGeneric by CGeneric(), IInt // Can't test right now due to https://youtrack.jetbrains.com/issue/KT-10258 // abstract class Test9 : IGeneric by CGeneric(), IGeneric -abstract class Test10 : IInt by CInt(), IStr by CStr(), IAny by CAny() +abstract class Test10 : IInt by CInt(), IStr by CStr(), IAny by CAny() -abstract class Test11 : IInt, IStr by CStr(), IAny by CAny() +abstract class Test11 : IInt, IStr by CStr(), IAny by CAny() abstract class Test12 : IInt, IStr, IAny by CAny() diff --git a/compiler/testData/diagnostics/tests/delegation/clashes/returnTypeMismatch.fir.kt b/compiler/testData/diagnostics/tests/delegation/clashes/returnTypeMismatch.fir.kt index 1b7454f373f..d5a08e52976 100644 --- a/compiler/testData/diagnostics/tests/delegation/clashes/returnTypeMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/delegation/clashes/returnTypeMismatch.fir.kt @@ -36,7 +36,7 @@ abstract class Test1 : IStr by CStr(), IInt abstract class Test2 : IStr, IInt by CInt() -abstract class Test3 : IStr by CStr(), IInt by CInt() +abstract class Test3 : IStr by CStr(), IInt by CInt() abstract class Test4 : IStr by CStr(), IGeneric @@ -51,9 +51,9 @@ abstract class Test8 : IGeneric by CGeneric(), IInt // Can't test due to https://youtrack.jetbrains.com/issue/KT-10258 // abstract class Test9 : IGeneric by CGeneric(), IGeneric -abstract class Test10 : IInt by CInt(), IStr by CStr(), IAny by CAny() +abstract class Test10 : IInt by CInt(), IStr by CStr(), IAny by CAny() -abstract class Test11 : IInt, IStr by CStr(), IAny by CAny() +abstract class Test11 : IInt, IStr by CStr(), IAny by CAny() abstract class Test12 : IInt, IStr, IAny by CAny() diff --git a/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.fir.kt b/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.fir.kt deleted file mode 100644 index 0d7901d14f0..00000000000 --- a/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -interface ILeft { - fun foo() {} -} - -interface IRight { - fun foo() -} - -interface IDerived : ILeft, IRight - -class CDerived : ILeft, IRight - -abstract class ADerived : ILeft, IRight \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.kt b/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.kt index 8c06a401c97..83d2d249f6e 100644 --- a/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.kt +++ b/compiler/testData/diagnostics/tests/java8Overrides/defaultVsAbstract.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface ILeft { fun foo() {} } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.fir.kt index 675f9586dc7..54b63c6aae6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity.fir.kt @@ -10,9 +10,9 @@ interface B{ } } -interface AB: A, B +interface AB: A, B -interface BA: B, A +interface BA: B, A interface C : A, B { diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.fir.kt index cde952cd170..8b6e555c7da 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity2.fir.kt @@ -9,9 +9,9 @@ interface B{ } } -interface AB: A, B +interface AB: A, B -interface BA: B, A +interface BA: B, A class C : A, B { override fun test() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.fir.kt index 923f86ef6ee..b34e87ce3a2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/superCallAmbiguity3.fir.kt @@ -9,8 +9,8 @@ interface A { interface B{ fun test() } -interface AB : A, B -interface BA : B, A +interface AB : A, B +interface BA : B, A class C : A, B { override fun test() {