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
+5 -5
View File
@@ -1,11 +1,11 @@
open class NoC
class NoC1 : NoC
class NoC1 : <!SUPERTYPE_NOT_INITIALIZED!>NoC<!>
class WithC0() : NoC()
open class WithC1() : NoC
class NoC2 : WithC1
open class WithC1() : <!SUPERTYPE_NOT_INITIALIZED!>NoC<!>
class NoC2 : <!SUPERTYPE_NOT_INITIALIZED!>WithC1<!>
class NoC3 : WithC1()
class WithC2() : WithC1
class WithC2() : <!SUPERTYPE_NOT_INITIALIZED!>WithC1<!>
class WithPC0() {
}
@@ -32,4 +32,4 @@ class NoCPI {
var ab = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>1<!>
get() = 1
set(v) {}
}
}
@@ -38,12 +38,12 @@ interface Test6 : <!INTERFACE_WITH_SUPERCLASS!>C1<!> {}
class CTest1() : OC1() {}
class CTest2 : C2 {}
class CTest2 : <!SUPERTYPE_NOT_INITIALIZED!>C2<!> {}
class CTest3 : C2, C3 {}
class CTest3 : <!SUPERTYPE_NOT_INITIALIZED!>C2<!>, C3 {}
class CTest4 : T1 {}
class CTest5 : T1, T1 {}
class CTest6 : C1 {}
class CTest6 : <!SUPERTYPE_NOT_INITIALIZED!>C1<!> {}
@@ -10,10 +10,10 @@ package test.p; class C {fun f() {}}
package test.p; open class G<T> {open fun f(): T {} fun a() {}}
// FILE: d.kt
package test.p; class G2<E> : G<E> { fun g() : E {} override fun f() : E {}}
package test.p; class G2<E> : <!SUPERTYPE_NOT_INITIALIZED!>G<E><!> { fun g() : E {} override fun f() : E {}}
// FILE: e.kt
package test.p; fun foo() {}
// FILE: f.kt
package test.p; fun foo(a: C) {}
package test.p; fun foo(a: C) {}
@@ -4,7 +4,7 @@
expect open class A
expect class B : A
open class C : A
open class C : <!SUPERTYPE_NOT_INITIALIZED!>A<!>
// MODULE: m1-jvm(m1-common)
// FILE: jvm.kt
@@ -15,4 +15,4 @@ actual typealias Presence = P
sealed class P {
object Online : P()
object Offline : P()
}
}
+2 -2
View File
@@ -4,9 +4,9 @@ package toplevelObjectDeclarations
open fun foo() : Int = 1
}
<!INAPPLICABLE_CANDIDATE!>class T : Foo {}<!>
<!INAPPLICABLE_CANDIDATE!>class T : <!SUPERTYPE_NOT_INITIALIZED!>Foo<!> {}<!>
<!INAPPLICABLE_CANDIDATE!>object A : Foo {
<!INAPPLICABLE_CANDIDATE!>object A : <!SUPERTYPE_NOT_INITIALIZED!>Foo<!> {
val x : Int = 2
fun test() : Int {