Merge "diagnostic with Java 8" tests with general diagnostic tests
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// FULL_JDK
|
||||
|
||||
import java.util.*
|
||||
import java.util.stream.Stream
|
||||
|
||||
fun <T> Stream<T>?.getIfSingle() =
|
||||
this?.map { Optional.ofNullable(it) }
|
||||
?.reduce(Optional.empty()) { _, _ -> Optional.empty() }
|
||||
?.orElse(null) // <<---- should not be an error
|
||||
Reference in New Issue
Block a user