FIR checker: report SUPERTYPE_NOT_INITIALIZED

Combined this and the checker of
SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR together.

Also fixed SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR incorrectly
repoted as warning instead of error.
This commit is contained in:
Tianyu Geng
2021-03-09 15:25:05 -08:00
committed by Dmitriy Novozhilov
parent 6134c00698
commit 56bec6997c
30 changed files with 256 additions and 107 deletions
@@ -16,7 +16,7 @@ fun test(z: Int, c: Char) {}
}<!>
<!REDECLARATION!>class B : A {
<!REDECLARATION!>class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
<!CONFLICTING_OVERLOADS!>override fun rest(s: String)<!> {}
<!CONFLICTING_OVERLOADS!>fun rest(s: String)<!> {}
@@ -2,7 +2,7 @@ class A {
fun f() {}
}
class B : A {
class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
fun g() {
<!NOT_A_SUPERTYPE!>super<String><!>.<!UNRESOLVED_REFERENCE!>f<!>()
super<A>.f()
@@ -2,7 +2,7 @@ open class A {
open var test: Number = 10
}
open class B : A {
open class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
override var test: <!VAR_TYPE_MISMATCH_ON_OVERRIDE!>Double<!> = 20.0
}
@@ -2,7 +2,7 @@ open class A {
open fun test(): Number = 10
}
open class B : A {
open class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
override fun test(): Double = 20.0
fun test(x: Int) = x
}
@@ -1,8 +1,8 @@
class A
class B : A
class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!>
class C(x: Int)
<!INAPPLICABLE_CANDIDATE!>class D : C<!>
<!INAPPLICABLE_CANDIDATE!>class D : <!SUPERTYPE_NOT_INITIALIZED!>C<!><!>
class E : C(10)
class F() : C(10)