Check lateinit applicability for local variables
TODO probably should be refactored together with DeclarationsChecker
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VALUE -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
|
||||
|
||||
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
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user