[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,87 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -NOTHING_TO_INLINE
// FILE: test.kt
interface Base {
var x: String
}
open class Foo : Base {
override lateinit var x: String
private lateinit var y: String
var nonLateInit: Int = 1
fun ok() {
val b: Boolean = this::x.isInitialized
val otherInstance = Foo()
otherInstance::x.isInitialized
(this::x).isInitialized
(@Suppress("ALL") (this::x)).isInitialized
object {
fun local() {
class Local {
val xx = this@Foo::x.isInitialized
val yy = this@Foo::y.isInitialized
}
}
}
}
fun onLiteral() {
val p = this::x
p.isInitialized
}
fun onNonLateinit() {
this::nonLateInit.isInitialized
}
inline fun inlineFun() {
this::x.isInitialized
object {
val z = this@Foo::x.isInitialized
}
}
inner class InnerSubclass : Foo() {
fun innerOk() {
// This is access to Foo.x declared lexically above
this@Foo::x.isInitialized
// This is access to InnerSubclass.x which is inherited from Foo.x
this::x.isInitialized
}
}
}
fun onNonAccessible() {
Foo()::x.isInitialized
}
fun onNonLateinit() {
Foo()::nonLateInit.isInitialized
}
object Unrelated {
fun onNonAccessible() {
Foo()::x.isInitialized
}
}
class FooImpl : Foo() {
fun onNonAccessible() {
this::x.isInitialized
}
}
// FILE: other.kt
class OtherFooImpl : Foo() {
fun onNonAccessible() {
this::x.isInitialized
}
}