<@UCML5J482> Can we benefit from IDE K2 mode if we...
# intellij
t
@Anton Yalyshev [JB] Can we benefit from IDE K2 mode if we still compile with KGP 1.8/9 in Gradle. And the reverse: Is IDE K2 mode mandatory if we use KGP 2.+ in Gradle?
a
It is not mandatory and these things (build settings and IDE mode) are not depend on each other in ~ 99.9% percent of cases. What I mean by 0.1%. There is a very limited set of code constructions, that are possible in K1 compiler and lead to error in K2 compiler. So K2-IDE mode will highlight such code as red, whereas it will be compilable by K1 compiler. K1/K2 -IDE mode only defines how code will be analyzed in IDE, but doesn’t affect build settings.
t
I think that 0.1% false positive is fair as we'll need to fix those anyway when we update the compiler. 🤦‍♂️It feels trivial after your explanation that K2 is source-compatible with any(* see above) Kotlin source code and even compiled binaries.