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
In the following switch statement there are two cases that both check if char = ' '.
The lint incorrectly marks the second test as invariant_booleans as it sees the if char = ' ' in the first case and assume that the test protects the second case from having a space.
If you change the first char = ' ' in the first case to anything else the warning goes away.
The lint should not fire in this scenario.
enum_ParseState { starting, inQuote, inWord }
/// parses the given command breaking them done into wordsvoid_parse2(String commandLine) {
var state =_ParseState.starting;
for (var i =0; i < commandLine.length; i++) {
final char = commandLine[i];
switch (state) {
case_ParseState.starting:if (char ==' ') {
break;
}
break;
case_ParseState.inWord:if (char ==' ')
{
break;
}
}
}
}
The text was updated successfully, but these errors were encountered:
When using lint 1.5.1
In the following switch statement there are two cases that both check if char = ' '.
The lint incorrectly marks the second test as invariant_booleans as it sees the if char = ' ' in the first case and assume that the test protects the second case from having a space.
If you change the first char = ' ' in the first case to anything else the warning goes away.
The lint should not fire in this scenario.
The text was updated successfully, but these errors were encountered: