Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt8132.kt
T
Svetlana Isakova 4c8b75928e Added tests
#KT-6179 Fixed
  #KT-8132 Fixed
2015-07-10 15:05:10 +03:00

11 lines
355 B
Kotlin
Vendored

// !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()