choose the most specific candidate after type inference

This commit is contained in:
Svetlana Isakova
2012-08-06 16:37:48 +04:00
parent b24509577c
commit 679a678e7c
3 changed files with 27 additions and 9 deletions
@@ -0,0 +1,22 @@
package i
//+JDK
import java.util.*
fun <T, R> Collection<T>.map1(<!UNUSED_PARAMETER!>f<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun <T, R> java.lang.Iterable<T>.map1(<!UNUSED_PARAMETER!>f<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun test(list: List<Int>) {
val res = list.map1 { it }
//check res is not of error type
<!TYPE_MISMATCH!>res<!> : String
}
fun <T> Collection<T>.foo() {}
fun <T> java.lang.Iterable<T>.foo() {}
fun test1(list: List<Int>) {
val res = list.foo()
//check res is not of error type
<!TYPE_MISMATCH!>res<!> : String
}