[Tests] Test samples from KEEP

This commit is contained in:
Anastasiya Shadrina
2021-09-06 18:43:33 +07:00
committed by TeamCityServer
parent b0a7be72e8
commit d8faa9686d
50 changed files with 1077 additions and 51 deletions
@@ -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<!UNRESOLVED_LABEL!>@IterableClass<!>.invoke(this)
fun <T> listOf(vararg items: T): List<T> = null!!
fun test() {
val f: IterableClass<List<Int>, Int> = {
it.listIterator()
}
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>with<!>(f) {
listOf(1, 2, 3).iterator(null)
}
listOf(1, 2, 3).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>iterator<!>(null)
}