Skip to content
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

Remove the fallback exhaustiveness algorithm #51518

Closed
stereotype441 opened this issue Feb 24, 2023 · 1 comment
Closed

Remove the fallback exhaustiveness algorithm #51518

stereotype441 opened this issue Feb 24, 2023 · 1 comment
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-front-end Use area-front-end for front end / CFE / kernel format related issues. P3 A lower priority bug or feature request

Comments

@stereotype441
Copy link
Member

There are new test failures on Enable the fallback exhaustiveness algorithm (with improvements)..

This is happening because the fallback exhaustiveness algorithm is a rough (but sound) under-approximation of how we want soundness to behave in the long run. That is, if a switch statement or switch expression is not exhaustive, the fallback exhaustiveness algorithm will reliably classify it as non-exhaustive (and generate the appropriate error), but it also generates errors for a lot of switch statements and switch expressions that actually are exhaustive. Also, it doesn't detect unreachable switch cases.

The tests

co19/LanguageFeatures/Patterns/constant_A01_t03 CompileTimeError (expected Pass)
co19/LanguageFeatures/Patterns/constant_A02_t03 CompileTimeError (expected Pass)
co19/LanguageFeatures/Patterns/constant_A02_t06 CompileTimeError (expected Pass)
co19/LanguageFeatures/Patterns/constant_A02_t09 CompileTimeError (expected Pass)
co19/LanguageFeatures/Patterns/constant_A02_t12 CompileTimeError (expected Pass)
co19/LanguageFeatures/Patterns/switch_expression_A01_t01 MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/bool_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/enum_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/object_pattern_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/record_literal_named_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/record_literal_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/record_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/sealed_class_switch_test MissingCompileTimeError (expected Pass)
language/patterns/exhaustiveness/variable_pattern_switch_test MissingCompileTimeError (expected Pass)
language/switch/switch_test CompileTimeError (expected Pass)
language/switch/switch_test/0 CompileTimeError (expected Pass)
language/switch/switch_test/1 CompileTimeError (expected Pass)
language/switch/switch_test/2 CompileTimeError (expected Pass)
language/switch/switch_test/3 CompileTimeError (expected Pass)

are failing on configurations

analyzer-asserts-linux
cfe-strong-linux
cfe-weak-linux
dart2js-hostasserts-strong-linux-x64-chrome
dart2js-hostasserts-strong-linux-x64-d8
dart2js-hostasserts-weak-linux-x64-chrome
dart2js-hostasserts-weak-linux-x64-d8
dart2wasm-hostasserts-linux-x64-d8
dartdevk-strong-linux-release-chrome
dartdevk-weak-linux-release-chrome
dartk-strong-linux-debug-x64
dartk-strong-linux-release-x64
dartk-weak-asserts-linux-debug-x64
dartk-weak-asserts-linux-release-x64

CC @johnniwinther

@stereotype441 stereotype441 added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-front-end Use area-front-end for front end / CFE / kernel format related issues. labels Feb 24, 2023
@stereotype441
Copy link
Member Author

See also TODOs in 7e5297e

@pq pq added the P3 A lower priority bug or feature request label Feb 27, 2023
@johnniwinther johnniwinther self-assigned this Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-front-end Use area-front-end for front end / CFE / kernel format related issues. P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

3 participants