Partially revert "[FE] Stop ignoring ABSTRACT_MEMBER_NOT_IMPLEMENTED for expect classes"

^KT-61039 Fixed
KT-59739 is now open for K1 (but fixed in K2)
Review: https://jetbrains.team/p/kt/reviews/11867/timeline

This partially reverts commit 4f3ecedbca.
Only K1 part is reverted.

Motivation for revert: KT-59739 cannot be properly fixed in K1 because
of the bug it causes - KT-61039

We just accepted that we will have one more "green in K1 -> red in K2"
case
This commit is contained in:
Nikita Bobko
2023-08-24 18:55:49 +02:00
committed by teamcity
parent 3534a4b7a9
commit 373abbde5d
9 changed files with 22 additions and 16 deletions
@@ -5,7 +5,7 @@ interface Base {
fun foo()
}
expect open <!ABSTRACT_MEMBER_NOT_IMPLEMENTED, ABSTRACT_MEMBER_NOT_IMPLEMENTED{JVM}!>class Foo<!> : Base
expect open class Foo : Base
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
@@ -11,7 +11,7 @@ interface Base {
// Mismatched scope must be reported here. But it's false negative checker in K1.
// For some reason, K1 says that modality of `exect_Foo.foo` is `abstract`.
// Luckily, we report ABSTRACT_MEMBER_NOT_IMPLEMENTED additionally.
// https://youtrack.jetbrains.com/issue/KT-59739
actual open class Foo : Base {
override fun foo() {}
}
@@ -3,7 +3,7 @@
interface Base {
fun foo()
}
expect open <!ABSTRACT_MEMBER_NOT_IMPLEMENTED, ABSTRACT_MEMBER_NOT_IMPLEMENTED{JVM}!>class Foo<!>() : Base
expect open class Foo() : Base
// MODULE: m2-jvm()()(m1-common)
@@ -11,7 +11,7 @@ expect open <!ABSTRACT_MEMBER_NOT_IMPLEMENTED, ABSTRACT_MEMBER_NOT_IMPLEMENTED{J
// Mismatched scope must be reported here. But it's false negative checker in K1.
// For some reason, K1 says that modality of `exect_Foo.foo` is `abstract`.
// Luckily, we report ABSTRACT_MEMBER_NOT_IMPLEMENTED additionally.
// https://youtrack.jetbrains.com/issue/KT-59739
actual open class Foo : Base {
override fun foo() {}
}
@@ -5,7 +5,7 @@ interface Base {
fun foo()
}
expect <!ABSTRACT_MEMBER_NOT_IMPLEMENTED, ABSTRACT_MEMBER_NOT_IMPLEMENTED{JVM}!>object Implementation<!> : Base
expect object Implementation : Base
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
@@ -5,13 +5,13 @@ interface Foo {
fun foo()
}
expect <!ABSTRACT_MEMBER_NOT_IMPLEMENTED, ABSTRACT_MEMBER_NOT_IMPLEMENTED{JVM}!>class ImplicitFoo<!> : Foo
expect class ImplicitFoo : Foo
expect class ExplicitFoo : Foo {
override fun foo()
}
expect <!ABSTRACT_MEMBER_NOT_IMPLEMENTED, ABSTRACT_MEMBER_NOT_IMPLEMENTED{JVM}!>class ImplicitFooCheck<!> : Foo
expect class ImplicitFooCheck : Foo
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
@@ -4,9 +4,9 @@
expect abstract class BaseA() {
abstract fun foo()
}
expect open <!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class BaseAImpl<!>() : BaseA
expect open class BaseAImpl() : BaseA
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class DerivedA1<!> : BaseAImpl()
class DerivedA1 : BaseAImpl()
class DerivedA2 : BaseAImpl() {
override fun foo() = super.foo()
}
@@ -16,7 +16,7 @@ class DerivedA2 : BaseAImpl() {
expect interface BaseB {
fun foo()
}
expect open <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class BaseBImpl<!>() : BaseB
expect open class BaseBImpl() : BaseB
class DerivedB1 : BaseBImpl()
class DerivedB2 : BaseBImpl() {
@@ -58,7 +58,7 @@ sealed class BaseEImpl() : BaseE {
expect interface BaseF {
fun foo()
}
expect <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class BaseFImpl<!>() : BaseF
expect class BaseFImpl() : BaseF
@@ -5,7 +5,7 @@ expect abstract class Base {
abstract fun foo()
}
expect <!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED, ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED{JVM}!>class DerivedImplicit<!> : Base
expect class DerivedImplicit : Base
expect class DerivedExplicit : Base {
override fun foo()