`filter` must preserve type if you want to explici...
# getting-started
d
filter
must preserve type if you want to explicitly change the type from
List<Pair<Int?, Int>>
to
List<Pair<Int, Int>>
, you can:
Copy code
fun explicitlyMapType() {
    val map = HashMap<Int, Int>()
    fun plusOne(i: Int): Int = i + 1
    arrayOf(1, 2, 3)
        .map { Pair(map[it], it) }
        .filter { it.first != null }
        .map { Pair(it.first!!, it.second) }
        .map { plusOne(it.first) }
}