// !CHECK_TYPE package i //+JDK import java.util.* import checkSubtype fun Collection.map1(f : (T) -> R) : List {} fun java.lang.Iterable.map1(f : (T) -> R) : List {} fun test(list: List) { val res = list.map1 { it } //check res is not of error type checkSubtype(res) } fun Collection.foo() {} fun java.lang.Iterable.foo() {} fun test1(list: List) { val res = list.foo() //check res is not of error type checkSubtype(res) }