test for obsolete KT-2741

#KT-2741 obsolete
This commit is contained in:
Svetlana Isakova
2012-12-26 18:01:23 +04:00
parent 4dc51901ba
commit 38cc3e39e4
2 changed files with 16 additions and 0 deletions
@@ -0,0 +1,11 @@
//KT-2741 Compiler can't infer a type of a function literal parameter when its body contains errors
package a
fun <T, R: Comparable<R>> Iterable<T>._sortBy(<!UNUSED_PARAMETER!>f<!>: (T) -> R): List<T> = throw Exception()
fun _arrayList<T>(vararg <!UNUSED_PARAMETER!>values<!>: T) : List<T> = throw Exception()
class _Pair<A>(val a: A)
fun test() {
_arrayList(_Pair(1))._sortBy { it -> <!UNRESOLVED_REFERENCE!>xxx<!> }
}
@@ -2197,6 +2197,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/inference/regressions/kt2514.kt");
}
@TestMetadata("kt2741.kt")
public void testKt2741() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/regressions/kt2741.kt");
}
@TestMetadata("kt2838.kt")
public void testKt2838() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt");