FirNotImplementedOverrideChecker: check also anonymous objects / enums

This commit is contained in:
Mikhail Glukhikh
2021-03-24 11:23:59 +03:00
parent 82b8cc333e
commit 449a79151a
19 changed files with 44 additions and 64 deletions
@@ -7,7 +7,7 @@ public interface SomeTrait {
}
fun foo() {
val x = object : SomeTrait {
val x = <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>object<!> : SomeTrait {
}
x.foo()
}
@@ -17,5 +17,5 @@ fun foo() {
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class C<!> : SomeTrait {}
fun foo2() {
val r = object : Runnable {} //no error
val r = <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>object<!> : Runnable {} //no error
}
@@ -1,13 +0,0 @@
enum class EnumClass {
E1 {
override fun foo() = 1
override val bar: String = "a"
},
E2 {
};
abstract fun foo(): Int
abstract val bar: String
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
enum class EnumClass {
E1 {
override fun foo() = 1
@@ -1,11 +0,0 @@
interface P {
var f: Number
}
open class Q {
val x: Int = 42
}
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class R<!> : P, Q()
val s: Q = object : Q(), P {}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface P {
var f: Number
}
@@ -1,7 +1,7 @@
interface Base {
fun foo()
}
val String.test: Base = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>object: Base<!> {
val String.test: Base = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>object<!>: Base {
override fun foo() {
<!UNRESOLVED_LABEL!>this@test<!>
}