[CP] A roll of dart_style which can format empty nullable record types ()?
#52591
Labels
area-meta
Cross-cutting, high-level issues (for tracking many other implementation issues, ...).
cherry-pick-approved
Label for approved cherrypick request
cherry-pick-merged
Cherry-pick has been merged to the stable or beta branch.
cherry-pick-review
Issue that need cherry pick triage to approve
merge-to-stable
Commit(s) to merge
7c83e8a
Target
stable
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/306911
Issue Description
The formatter has a bug where a nullable type record with no fields (i.e.
()?
) discards the?
. The formatter has an internal self-check that it only changes whitespace which fails and the result is that the formatter exits with an error message and doesn't format the file at all.What is the fix
The fix is a trivial one-line change that preserves the
?
if there is one. There are no other changes in this dart_style roll.Why cherry-pick
I don't expect nullable empty record types to be very common, but they are valid and meaningful, and without this fix, users are completely unable to format any part of a file that happens to contain
()?
.Risk
low
Issue link(s)
dart-lang/dart_style#1224
Extra Info
No response
The text was updated successfully, but these errors were encountered: