FIR checker: report uninitialized member/extension properties
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
e8028e7825
commit
e009b71f88
+69
@@ -0,0 +1,69 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun <T> lazy(initializer: () -> T): Lazy<T> = <!UNRESOLVED_REFERENCE!>TODO<!>()
|
||||
interface Lazy<out T> {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = <!UNRESOLVED_REFERENCE!>TODO<!>()
|
||||
}
|
||||
|
||||
expect class OuterClass {
|
||||
class NestedClass {
|
||||
class DeepNested {
|
||||
class Another {
|
||||
fun f(s: String)
|
||||
val p: Int
|
||||
val c: Int = <!EXPECTED_PROPERTY_INITIALIZER!>1<!>
|
||||
val a: Int by <!EXPECTED_DELEGATED_PROPERTY!>lazy { 1 }<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class InnerClass {
|
||||
fun f(x: Int)
|
||||
val p: String
|
||||
}
|
||||
|
||||
companion object
|
||||
}
|
||||
|
||||
expect class OuterClassWithNamedCompanion {
|
||||
companion object Factory
|
||||
}
|
||||
|
||||
expect object OuterObject {
|
||||
object NestedObject
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class OuterClass {
|
||||
actual class NestedClass {
|
||||
actual class DeepNested {
|
||||
actual class Another {
|
||||
actual fun f(s: String) {}
|
||||
actual val p: Int = 42
|
||||
actual val c: Int = 2
|
||||
actual val a: Int = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actual inner class InnerClass {
|
||||
actual fun f(x: Int) {}
|
||||
actual val p: String = ""
|
||||
}
|
||||
|
||||
actual companion object
|
||||
}
|
||||
|
||||
actual class OuterClassWithNamedCompanion {
|
||||
actual companion object Factory
|
||||
}
|
||||
|
||||
actual object OuterObject {
|
||||
actual object NestedObject
|
||||
}
|
||||
+11
-1
@@ -1,7 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun <T> lazy(initializer: () -> T): Lazy<T> = <!UNRESOLVED_REFERENCE!>TODO<!>()
|
||||
interface Lazy<out T> {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = <!UNRESOLVED_REFERENCE!>TODO<!>()
|
||||
}
|
||||
|
||||
expect class OuterClass {
|
||||
class NestedClass {
|
||||
@@ -9,6 +15,8 @@ expect class OuterClass {
|
||||
class Another {
|
||||
fun f(s: String)
|
||||
val p: Int
|
||||
val c: Int = <!EXPECTED_PROPERTY_INITIALIZER, EXPECTED_PROPERTY_INITIALIZER{JVM}!>1<!>
|
||||
val a: Int <!EXPECTED_DELEGATED_PROPERTY, EXPECTED_DELEGATED_PROPERTY{JVM}!>by lazy { 1 }<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,6 +46,8 @@ actual class OuterClass {
|
||||
actual class Another {
|
||||
actual fun f(s: String) {}
|
||||
actual val p: Int = 42
|
||||
actual val c: Int = 2
|
||||
actual val a: Int = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+22
@@ -1,6 +1,15 @@
|
||||
// -- Module: <m1-common> --
|
||||
package
|
||||
|
||||
public fun </*0*/ T> lazy(/*0*/ initializer: () -> T): Lazy<T>
|
||||
|
||||
public interface Lazy</*0*/ out T> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final expect class OuterClass {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -31,6 +40,8 @@ public final expect class OuterClass {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final expect class Another {
|
||||
public expect final val a: kotlin.Int
|
||||
public expect final val c: kotlin.Int = 1
|
||||
public expect final val p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final expect fun f(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
@@ -68,6 +79,15 @@ public expect object OuterObject {
|
||||
// -- Module: <m2-jvm> --
|
||||
package
|
||||
|
||||
public fun </*0*/ T> lazy(/*0*/ initializer: () -> T): Lazy<T>
|
||||
|
||||
public interface Lazy</*0*/ out T> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final actual class OuterClass {
|
||||
public constructor OuterClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -104,6 +124,8 @@ public final actual class OuterClass {
|
||||
|
||||
public final actual class Another {
|
||||
public constructor Another()
|
||||
public actual final val a: kotlin.Int = 3
|
||||
public actual final val c: kotlin.Int = 2
|
||||
public actual final val p: kotlin.Int = 42
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final actual fun f(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
|
||||
Reference in New Issue
Block a user