This looks like a bug to me - but is it in the Kotlin compiler, or IDEA, or both?
https://pl.kotl.in/Ry0Q76YWi
Using flatMap inside buildList makes the compiler flag accessing the Pair components due to some ambiguity. When I specify the type explicitly (buildList<…>), then it works, but IDEA flags the explicit type as redundant and unnecessary.
Seems like two distinct bugs …
a
Alexey Belkov [JB]
12/10/2021, 11:03 AM
It's probably a complicated case of builder inference, which is not completely stabilized yet, so the compiler can't infer types. The fact that IDE shows an inspection is a bug - types are not redundant.