test for KT-2407

#KT-2407 fixed
This commit is contained in:
Svetlana Isakova
2012-08-08 14:27:22 +04:00
parent eb608f2ae9
commit 6e67bd64fa
2 changed files with 21 additions and 0 deletions
@@ -0,0 +1,16 @@
package n
import java.util.*
fun test() {
val foo = arrayList("").map { it -> it.length }.fold(0, { x, y -> Math.max(x, y) })
foo : Int
<!TYPE_MISMATCH!>foo<!> : String
}
//from library
fun arrayList<T>(vararg <!UNUSED_PARAMETER!>values<!>: T) : ArrayList<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun <T, R> Collection<T>.map(<!UNUSED_PARAMETER!>transform<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun <T> java.lang.Iterable<T>.fold(<!UNUSED_PARAMETER!>initial<!>: T, <!UNUSED_PARAMETER!>operation<!>: (T, T) -> T): T {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>