You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the patterns spec
(https://github.com/dart-lang/language/blob/main/accepted/3.0/patterns/feature-specification.md),
if `A` is the type of the formal parameter of the operator
declaration, then operand should be type checked with context type
`A?` when op is `==` or `!=`, and with context type `A` otherwise.
Prior to this commit, context type `A` was always used.
There should be no observable behavior difference, because the operand
of a relational operator is required to be a constant expression, and
there is no constant expression that behaves differently when its
context is `A?` vs `A`.
However, we are contemplating some possible future language changes
that *would* make the difference observable (e.g.,
dart-lang/language#3471), so it seems
prudent to fix the behavior to match the spec.
Change-Id: Ib3a1c82de45c65a851cbd613899ba1f72c215fbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346420
Commit-Queue: Paul Berry <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
0 commit comments