Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Don't split before `.` following a record literal (#1213).
* Don't force split on a line comment before a switch expression case (#1215).
* Require `package:analyzer` `^5.12.0`.
* Preserve `?` on nullable empty record types (#1224).

# 2.3.1

Expand Down
1 change: 1 addition & 0 deletions lib/src/source_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2505,6 +2505,7 @@ class SourceVisitor extends ThrowingAstVisitor {
if (node.rightParenthesis.precedingComments != null) soloZeroSplit();

token(node.rightParenthesis);
token(node.question);
return;
}

Expand Down
6 changes: 5 additions & 1 deletion test/whitespace/record_types.unit
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@
>>> nullable record type
( int , bool ) ? x;
<<<
(int, bool)? x;
(int, bool)? x;
>>> empty nullable record type
( ) ? x;
<<<
()? x;