Commit Graph

6 Commits

Author SHA1 Message Date
Johnni Winther 2836f56729 [cfe] Decouple MatchingCache and MatchingExpressionVisitor from inference
This moves the computation values need for the lowering to the
inference visitor and passes these to the lowering through fields on
the patterns.

This prepares for performing lowering during constant evaluation.

Change-Id: I71a63ac3fd911d9b0cfa5de00a6d28e3b9571a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282600
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-13 10:37:00 +00:00
Johnni Winther f3f5f724c5 [cfe] Add matched type to patterns
This stores the matched type, as computed by the flow analysis, into
patterns that use it in their lowering.

This ensures that flow is taken into account in the matching expressions
and also prepares for decoupling the matching expression generation
from the inference visitor.

Change-Id: Ifabd3b027d91a70fcbc6bb4180fbb11406e70df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282401
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-13 10:37:00 +00:00
Johnni Winther 5d44b804cd [cfe] Avoid unnecessary switch statements
This changes the lowering of switch expressions and pattern switch
statements without continue to only use if-then-else

Change-Id: I3bcbb634ec3153a117c4bd6692a276c1c26e648d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279964
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-01-31 18:12:44 +00:00
Chloe Stefantsova b0cc8afcc9 [cfe] Adjust scoping for single-head cases in pattern switches
Closes https://github.com/dart-lang/sdk/issues/50898
Closes https://github.com/dart-lang/sdk/issues/51112

Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I41d891021e266835bb71094b6096a36a14dd0275
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280103
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-01-31 13:48:40 +00:00
Paul Berry 9c08c99565 front_end: fix expectations for shared_errors test.
This test is failing on CFE bots, probably due to a conflict between
https://dart-review.googlesource.com/c/sdk/+/280086 and some other CL.
Updating the test expectations to turn the bots green again.

Change-Id: I8f2a38877bc4be3ee931674fd9ffecf3fc5a0e10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280127
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-01-31 00:34:49 +00:00
Johnni Winther ed7124884a [cfe] Implement shared error reporting
Change-Id: Ief8d557d0e6553fa79e7281172caccb00dfc5cfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280086
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-30 18:42:38 +00:00