Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

18 lines
494 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// ISSUE: KT-32249
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
class Wrapper<T>(val name: String, val defaultValue: T)
private fun <T> wrapper(defaultValue: T) = object : ReadOnlyProperty<Any, Wrapper<T>> {
override fun getValue(thisRef: Any, property: KProperty<*>): Wrapper<T> = null!!
}
object Foo {
val x by wrapper(true)
val y: Wrapper<Boolean> by wrapper(true)
}