Commit Graph

2 Commits

Author SHA1 Message Date
Paul Berry 0f11c4ed5a front_end: make use of TypeAnalyzer.analyzeConstantPattern.
This will allow the front end to take advantage of flow analysis
implied by a constant pattern (e.g. `case null` cause the scrutinee to
be promoted in later cases).

Fixes #51206.

Change-Id: Ic8516abb4e051ffca0d4e7698339282812020cae
Bug: https://github.com/dart-lang/sdk/issues/51206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281261
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-09 18:41:01 +00:00
Johnni Winther 0354903335 [cfe] Report errors on pattern assignment to final variables
Change-Id: I0c9f04e6108b1892731bc09eafb7c8de69fe675d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280380
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-03 08:52:26 +00:00