linter
linter copied to clipboard
invariant_booleans works incorrectly in switch
invariant_booleans works incorrectly in switch
in second examination buffer i have the analizator problem
Conditions should not unconditionally evaluate to
trueor tofalse. verify: buffer != null.
switch (callbackType) {
case dto.GeneratePdfCallbacks.progress:
if (buffer != null) {
onProgress(
DtoPdfDocumentValue.proggresFomGeneratePdfProgressBuffer(buffer),
);
return;
}
break;
case dto.GeneratePdfCallbacks.complete:
if (buffer != null) { /// <- at this place
onComplete(
DtoPdfDocument.fromGeneratePdfCompleteBuffer(buffer),
);
return;
}
break;
default:
super.callback(index, buffer);
break;
}
I think it is wrong behavior.
Thanks for the report @EvGeniyLell. This lint has a number of known issues and could definitely use some attention (or deprecation and removal). Sorry for the inconvenience.
Possible duplicates: #720 and #1859
We've deprecated invariant_booleans and will not be fixing correctness bugs going forward.