https://kotlinlang.org logo
#k2-early-adopters
Title
# k2-early-adopters
s

Sebastian Schuberth

03/09/2023, 7:25 AM
Is there a way to suppress the
Copy code
w: ATTENTION!
 This build uses experimental K2 compiler:
  -Xuse-k2
output? Otherwise projects with
allWarningsAsErrors = true
cannot participate in the early adoption.
👀 1
d

dmitriy.novozhilov

03/09/2023, 9:07 AM
There is no way to suppress it You can add
-Werror
flag only if
-Xuse-k2
is not passed in build scripts (we do the same for local compilation of Kotlin itself with K2 locally)
s

Sebastian Schuberth

03/09/2023, 11:04 AM
Right, but then there's a risk that in local builds / code committed locally to Git compiler warnings will get introduced. Would it be an option to make this configurable? Or actually drop it altogether, as the user already has explicitly opted-in for K2 via
useK2
, so why warn about it? Maybe make it just an info instead.
d

dmitriy.novozhilov

03/09/2023, 11:07 AM
Compilation with K2 without warnings does not guarantee that there won't be warnings with K1, because some warnings and errors differ between K1 and K2 and some of them are missing by design in K2 (e.g. K2 won't report about unused parameter) So it always be a blocker, because it's not recommended to use K2 on CI (because K2 is not quite ready for production)
s

Sebastian Schuberth

03/09/2023, 11:17 AM
Ok, makes sense, thanks.
6 Views