gildor
07/04/2017, 8:48 AM.map { it as SomeSpecificType }
Thread in Slack Conversation
czar: It’s defenetely not Kotlin problem. And actually not a problem at all.
You can rewrite this code to java and will get exactly the same behavior:
Stream.of(1, "two")
.filter(it -> it instanceof String)
.collect(Collectors.toList());
Return type of this steam is List<? extends Serializable>