So I ended up recompiling ktfmt core with kotlin compiler (org.jetbrains.kotlin:kotlin-compiler) rather than kotlin compiler embedded (org.jetbrains.kotlin:kotlin-compiler-embeddable) with required changes. And the conflict goes away. Although I would rather not maintain my own version of ktfmt, I guess this will be my solution.