-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Quick fixes for record positional record literals #51446
Comments
@bwilkerson I heard you might be interested in this |
Yes, I'm definitely interested. @keertip @pq might also be interested. I think the right solution here is to define a new diagnostic for this case (because that's how we can have a better message here). We might even be able to re-use Then we can create a fix that will add the comma. (That fix could be applied to a couple of other diagnostics as well.) |
I gave this a P2, but I'd really like to see it ship with the feature because I think it will help keep users on the rails. |
I agree. This feels like a significant foot-gun. I'l take a look. |
See: #51446 Change-Id: I4ebb0a8978bd98fc658737f69b790c2039c17d52 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284501 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
See: #51446 Change-Id: I372f05c6e87a5ee4b55edcb05cf05c035107f250 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284549 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
Completed w/ 43fbb1d. Thanks again for the report @CoderDake! |
Follow-up from #51446 Change-Id: I22de580e9a163dd371825a494ce92e2332edbb79 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285020 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
Tasks
RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA
b0078adRECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA
43fbb1dContext
While testing records I found that the following gives an error:
The error is:
After doing some reserearch into the spec I found out that records that look like this must have a trailing comma to show that they are a record. This was not immediately apparent when reading the errors or looking at the quick fixes though.
So the proper way to write this would have been:
It would be helpful if the error mentioned that records must end in a comma, or perhaps there was a quick fix that offered to add the trailing comma.
The text was updated successfully, but these errors were encountered: