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!>}<!>
@@ -1402,6 +1402,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/inference/regressions/kt2324.kt");
}
@TestMetadata("kt2407.kt")
public void testKt2407() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/regressions/kt2407.kt");
}
@TestMetadata("kt2445.kt")
public void testKt2445() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt");