You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formatting this code should not remove the import for CONSTANT.
importother.CONSTANTfunmain() {
if (CONSTANT&&true
) {
return
}
}
Observed Behavior
Ktlint outputs the following (which no longer compiles due to error: unresolved reference: CONSTANT):
funmain() {
if (CONSTANT&&true
) {
return
}
}
Steps to Reproduce
I created a sample to reproduce it here. Format and then compile to reproduce the error.
Notes:
It seems like correcting the && wrapping is key here, because other formatting fixes don't seem to trigger this same behavior.
Also if CONSTANT is referenced elsewhere in the same file, it will not be removed during formatting.
Your Environment
ktlint 0.37.2
The text was updated successfully, but these errors were encountered:
Expected Behavior
Formatting this code should not remove the import for
CONSTANT
.Observed Behavior
Ktlint outputs the following (which no longer compiles due to
error: unresolved reference: CONSTANT
):Steps to Reproduce
I created a sample to reproduce it here. Format and then compile to reproduce the error.
Notes:
It seems like correcting the
&&
wrapping is key here, because other formatting fixes don't seem to trigger this same behavior.Also if
CONSTANT
is referenced elsewhere in the same file, it will not be removed during formatting.Your Environment
ktlint 0.37.2
The text was updated successfully, but these errors were encountered: