Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.kt
T
Dmitriy Novozhilov 7fb2bf00c5 Force resolve annotations in annotation checker
#KT-46173 Fixed
2021-04-19 14:32:36 +03:00

21 lines
581 B
Kotlin
Vendored

// FIR_IDENTICAL
// FIR_DUMP
// WITH_REFLECT
import kotlin.reflect.KProperty
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
public operator fun <V, V1 : V> Map<in String, @kotlin.internal.Exact V>.getValue(thisRef: Any?, property: KProperty<*>): V1 = null!!
val m2: Map<String, *> = mapOf("baz" to "bat")
val bar: String get() = m2.getValue(null, ::bar)
fun foo() {
val m1: Map<String, Any> = mapOf("foo" to "bar")
val foo: String by m1
val baz: String by m2
println(foo) // bar
println(baz) // kotlin.KotlinNothingValueException
println(bar)
}