I'm using Kotlin 1.0.4. It seems in this example that IntelliJ is not able to figure out that allIDsAndURLs is of type List<Pair<Int, String>>. If I tell it explicitly what the type of allIDsAndURLs is, it works just fine. I suspect it's losing track after doToFirst gets involved, though it shouldn't.