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