[Tests] Test samples from KEEP
This commit is contained in:
committed by
TeamCityServer
parent
b0a7be72e8
commit
d8faa9686d
+16
@@ -0,0 +1,16 @@
|
||||
typealias IterableClass<C, T> = (C) -> Iterator<T>
|
||||
|
||||
context(IterableClass<C, T>)
|
||||
fun <C, T> C.iterator(any: Any?): Iterator<T> = this@IterableClass.invoke(this)
|
||||
|
||||
fun <T> listOf(vararg items: T): List<T> = null!!
|
||||
|
||||
fun test() {
|
||||
val f: IterableClass<List<Int>, Int> = {
|
||||
it.listIterator()
|
||||
}
|
||||
with(f) {
|
||||
listOf(1, 2, 3).iterator(null)
|
||||
}
|
||||
listOf(1, 2, 3).<!NO_CONTEXT_RECEIVER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>iterator<!>(null)<!>
|
||||
}
|
||||
Reference in New Issue
Block a user