Added tests

#KT-6179 Fixed
  #KT-8132 Fixed
This commit is contained in:
Svetlana Isakova
2015-07-03 01:33:11 +03:00
parent fc69cf1b5e
commit 4c8b75928e
6 changed files with 47 additions and 0 deletions
@@ -0,0 +1,11 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-8132 Can't omit lambda parameter types
fun <T> test(foo: List<T>): T {
return if (true)
throw IllegalStateException()
else
foo.reduce { left, right -> left } // error: inferred type T is not subtype Nothing
}
fun <S, T: S> Iterable<T>.reduce(operation: (S, T) -> S): S = throw Exception()
@@ -0,0 +1,4 @@
package
internal fun </*0*/ T> test(/*0*/ foo: kotlin.List<T>): T
internal fun </*0*/ S, /*1*/ T : S> kotlin.Iterable<T>.reduce(/*0*/ operation: (S, T) -> S): S
@@ -7175,6 +7175,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("kt8132.kt")
public void testKt8132() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/regressions/kt8132.kt");
doTest(fileName);
}
@TestMetadata("kt832.kt")
public void testKt832() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/regressions/kt832.kt");