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 …