Skip to content

Conversation

@munificent
Copy link
Member

We fixed the parser so that it can correctly handle:

[?.property]

Even if there is no space between ? and ., it knows to treat it as a dot shorthand inside a null-aware element here. So the formatter doesn't need to force insert a space in there to avoid ?. from being tokenized as a null-aware access.

See: dart-lang/language#4477

We fixed the parser so that it can correctly handle:

```dart
[?.property]
```

Even if there is no space between `?` and `.`, it knows to treat it as
a dot shorthand inside a null-aware element here. So the formatter
doesn't need to force insert a space in there to avoid `?.` from being
tokenized as a null-aware access.
@munificent munificent requested a review from kallentu August 8, 2025 00:09
@munificent munificent merged commit b5a166e into main Aug 8, 2025
7 checks passed
@munificent munificent deleted the no-null-aware-special-case branch August 8, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants