Added diagnostic tests for inference and incorporation

This commit is contained in:
Svetlana Isakova
2015-07-01 11:59:32 +03:00
parent 086e69e132
commit b8526e7048
24 changed files with 291 additions and 17 deletions
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import java.util.*
interface Foo
class Bar<B : Foo>(val list: MutableList<B>) {}
fun <F : Foo> test(map: MutableMap<String, Bar<F>>) {
map.getOrPut1("", { Bar(ArrayList()) })
}
fun <K, V> MutableMap<K, V>.getOrPut1(key: K, defaultValue: () -> V): V = throw Exception()