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,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class GenericClass<out T>
public fun <K, V> GenericClass<Map<K, V>>.foo() {}
public fun bar<T>(t: T, ext: GenericClass<T>.() -> Unit) {}
fun test() {
bar(mapOf(2 to 3)) { foo() }
}
// from library
class Pair<out A, out B>
fun <K, V> mapOf(keyValuePair: Pair<K, V>): Map<K, V> = throw Exception()
fun <A, B> A.to(that: B): Pair<A, B> = throw Exception()