Hey :wave: After migrating to Kotlin 1.4 we are g...
# announcements
s
Hey 👋 After migrating to Kotlin 1.4 we are getting the following error when using
flatMap()
.
Copy code
e: ../SomeClass.kt: Cannot choose among the following candidates without completing type inference: 
public inline fun <T, R> Iterable<String!>.flatMap(transform: (String!) -> Iterable<???>): List<???> defined in kotlin.collections
public inline fun <T, R> Iterable<String!>.flatMap(transform: (String!) -> Sequence<???>): List<???> defined in kotlin.collections
e: ../SomeClass.kt: (158, 49): Unresolved reference: it
And the code to repro this issue
Copy code
fun createStrings(strs: String): List<String> {
    return emptyList<String>()
}
...
emptyList<String>().flatMap { createStrings(it) }
Anyone managed to fix this?
d
Do you use stdlib version 1.4 with language version 1.3?
a
The language version is also 1.4
Copy code
kotlinOptions {
    apiVersion = '1.4'
    languageVersion = '1.4'
}
d
I can't reproduce this issue with such options