4c8b75928e
#KT-6179 Fixed #KT-8132 Fixed
11 lines
355 B
Kotlin
Vendored
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() |