Minor: move local lateinit tests to lateinit/local

This commit is contained in:
Dmitry Petrov
2017-07-19 16:37:18 +03:00
parent bbf9bf91fc
commit b12e20b2a3
7 changed files with 27 additions and 27 deletions
@@ -1,18 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VALUE -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
// !LANGUAGE: +LateinitLocalVariables
import kotlin.reflect.KProperty
object Delegate {
operator fun getValue(instance: Any?, property: KProperty<*>) : String = ""
operator fun setValue(instance: Any?, property: KProperty<*>, value: String) {}
}
fun test() {
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit<!> val test0: Any
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit<!> var test1: Int
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit<!> var test2: Any?
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit<!> var test3: String = ""
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit<!> var test4 by Delegate
}
@@ -1,12 +0,0 @@
package
public fun test(): kotlin.Unit
public object Delegate {
private constructor Delegate()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final operator fun getValue(/*0*/ instance: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun setValue(/*0*/ instance: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>, /*2*/ value: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1,7 +0,0 @@
// !LANGUAGE: +LateinitLocalVariables
fun test() {
lateinit var s: String
s = ""
s.length
}
@@ -1,3 +0,0 @@
package
public fun test(): kotlin.Unit
@@ -1,24 +0,0 @@
// !LANGUAGE: +LateinitLocalVariables
fun test1() {
lateinit var s: String
s.length
}
fun test2() {
lateinit var s: String
run {
s = ""
}
s.length
}
fun almostAlwaysTrue(): Boolean = true
fun test3() {
lateinit var s: String
if (almostAlwaysTrue()) {
s = ""
}
s.length
}
@@ -1,6 +0,0 @@
package
public fun almostAlwaysTrue(): kotlin.Boolean
public fun test1(): kotlin.Unit
public fun test2(): kotlin.Unit
public fun test3(): kotlin.Unit