mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 12:58:05 +00:00
7e5297e5f8
This change improves the fallback exhaustiveness algorithm so that it also takes advantage of the old, pre-patterns exhaustiveness logic for enums. This ensures that the fallback exhaustiveness algorithm won't seem like a regression to users who are used to the old pre-patterns behaviour. This required extending the old algorithm to handle new-style switch statements (which have a different representation from classic switch statements in the CFE) as well as switch expressions. We also turn on the fallback exhaustiveness algorithm by default. Unit tests can still disable it by temporarily setting the global variable `useFallbackExhaustivenessAlgorithm` to `false`. The hope is that this algorithm will be short-lived; we are just using it so that if we decide to enable pattern support in the near future, users will experience something that is sound. That is, it may require `default` or `_` cases more often than is strictly necessary, but it shouldn't ever allow a non-exhaustive switch in a place where an exhaustive switch is required. Change-Id: I4a8b7f996b109c4ee8832f286c3b3bf3b216fe8b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284840 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> |
||
---|---|---|
.. | ||
co19 | ||
co19_2 | ||
corelib | ||
corelib_2 | ||
dartdevc | ||
dartdevc_2 | ||
ffi | ||
ffi_2 | ||
language | ||
language_2 | ||
lib | ||
lib_2 | ||
modular | ||
standalone | ||
standalone_2 | ||
web | ||
web_2 | ||
legacy_status_dart2js.csv | ||
OWNERS | ||
README.md |
This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.