-
Notifications
You must be signed in to change notification settings - Fork 117
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
dart format produce invalid code #1404
Comments
Ouch. Can confirm on DartPad. |
Oof, nasty! I'll take a look. |
munificent
added a commit
that referenced
this issue
Feb 23, 2024
The fix here is pretty hacky, but this is in the old formatter which will be going away hopefully relatively soon. I honestly don't know how to fix it more elegantly and I'm a little worried that any more systemic fix will cause knock-on bugs since I don't have the old code loaded in my head as well as I used to. Fixes #1404.
This was referenced Feb 23, 2024
munificent
added a commit
that referenced
this issue
Feb 23, 2024
) The fix here is pretty hacky, but this is in the old formatter which will be going away hopefully relatively soon. I honestly don't know how to fix it more elegantly and I'm a little worried that any more systemic fix will cause knock-on bugs since I don't have the old code loaded in my head as well as I used to. Fixes #1404.
copybara-service bot
pushed a commit
to dart-lang/sdk
that referenced
this issue
Feb 26, 2024
This fixes a serious (but somewhat rare) bug where a line comment in a switch expression might eat subsequent cases. See: dart-lang/dart_style#1404 There are no other formatting changes. Change-Id: I7a1cb751c76abcd0507113635aab3f866a798364 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354063 Commit-Queue: Alexander Thomas <athom@google.com> Auto-Submit: Bob Nystrom <rnystrom@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try formatting:
produces:
which is obviously not valid Dart.
Reproduced with both Dart 3.3.0 and 3.4.0-157.0.dev, and 3.0.0 for that matter.
The text was updated successfully, but these errors were encountered: