Skip to content

Add exception about extension members in error about nullable receivers #4318

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

Merged
merged 2 commits into from
Jun 16, 2025
Merged
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
7 changes: 6 additions & 1 deletion accepted/2.12/nnbd/feature-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Status: Draft

## CHANGELOG

2025.06.16
- Add an exception for extension members in the error about nullable
receivers.

2021.07.28
- Allow a constant factory constructor in a class with a late final instance
variable.
Expand Down Expand Up @@ -531,7 +535,8 @@ location outside of the statement.

It is an error to call a method, setter, getter or operator on an expression
whose type is potentially nullable and not `dynamic`, except for the methods,
setters, getters, and operators on `Object`.
setters, getters, and operators on `Object`, and except when said member is an
extension member or the receiver type is an extension type.

It is an error to read a field or tear off a method from an expression whose
type is potentially nullable and not `dynamic`, except for the methods and
Expand Down