-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Remove 1745 decorative breaks #123259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove 1745 decorative breaks #123259
Conversation
848331f
to
d8a4be6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rslgtm!
@@ -113,7 +113,6 @@ Future<Command> startCommand(String executable, List<String> arguments, { | |||
switch (outputMode) { | |||
case OutputMode.print: | |||
print(line); | |||
break; | |||
case OutputMode.capture: | |||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we remove ones like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the case is empty, you still need the break. Otherwise, it would fall-through to the next case.
Part of #118837.
In Dart 3, the
break
statement is optional in switch/case. This PR removes them and enforces that with a lint. It also removes all lints that are no longer valid with Dart 3.Further reading: https://github.com/dart-lang/language/blob/master/accepted/future-releases/0546-patterns/feature-specification.md#implicit-break