I have the same problem, trying to move from 1.3 to 1.4 and getting the same error on flatMap.
I set in intellij: file/setting/build,execution,deployment/compiler/kotlin compiler language version to 1.4(stable)
And I still get this error.
Without a real solution we cannot move to 1.4…