Files
kotlin-fork/compiler/testData/diagnostics/tests/objects/Objects.fir.kt
T
Tianyu Geng 56bec6997c 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.
2021-03-24 17:48:39 +03:00

29 lines
489 B
Kotlin
Vendored

package toplevelObjectDeclarations
open class Foo(y : Int) {
open fun foo() : Int = 1
}
<!INAPPLICABLE_CANDIDATE!>class T : <!SUPERTYPE_NOT_INITIALIZED!>Foo<!> {}<!>
<!INAPPLICABLE_CANDIDATE!>object A : <!SUPERTYPE_NOT_INITIALIZED!>Foo<!> {
val x : Int = 2
fun test() : Int {
return x + foo()
}
}<!>
object B : A {}
val x = A.foo()
val y = object : Foo(x) {
init {
x + 12
}
override fun foo() : Int = 1
}
val z = y.foo()