Add one more test on delegated properties to check NI
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun test(i: Int) {
|
||||
val bad by myLazyDelegate {
|
||||
createSample(i) { it.toString() }
|
||||
}
|
||||
|
||||
takeSample(bad)
|
||||
}
|
||||
|
||||
fun <T> myLazyDelegate(i: () -> T): LazyDelegate<T> = LazyDelegate(i())
|
||||
|
||||
class LazyDelegate<T>(val v: T) {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO()
|
||||
}
|
||||
|
||||
class Sample<K, V>
|
||||
|
||||
fun takeSample(g: Sample<Int, String>) {}
|
||||
fun <T, S> createSample(i: T, a: (T) -> S): Sample<T, S> = TODO()
|
||||
Reference in New Issue
Block a user