Skip to content

Some switch case exhaustiveness tests are missing expected errors. #1995

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

Closed
leafpetersen opened this issue Apr 5, 2023 · 0 comments
Closed
Assignees
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good

Comments

@leafpetersen
Copy link
Member

leafpetersen commented Apr 5, 2023

Some tests are assuming that exhaustiveness for switch statements is available for the analysis which checks that functions always return a non-nullable value when required. Unfortunately, this is not true for the time being, see here. Therefore, the following tests need to be adjusted either to expect an additional error or to provide some exit path (return or throw) after the switch.

co19/LanguageFeatures/Patterns/Exhaustiveness/lifting_null_assert_pattern_A01_t01
co19/LanguageFeatures/Patterns/Exhaustiveness/lifting_null_check_pattern_A01_t01
... // Under triage, more to come

cc @eernstg

@sgrekhov sgrekhov self-assigned this Apr 5, 2023
@sgrekhov sgrekhov added the bad-test Report tests in need of updates. When closed, the tests should be considered good label Apr 5, 2023
sgrekhov added a commit to sgrekhov/co19 that referenced this issue Apr 5, 2023
@eernstg eernstg closed this as completed in 9fdbe8c Apr 5, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Apr 6, 2023
2023-04-05 [email protected] Fixes dart-lang/co19#1991. Runtime error fixed in matching_map_A02_t03.dart (dart-lang/co19#1999)
2023-04-05 [email protected] Fixes dart-lang/co19#1997. Update locations of the expected errors (dart-lang/co19#2001)
2023-04-05 [email protected] Fixes dart-lang/co19#1995. Use always-exhaustive type for testing spaces in switch statements (dart-lang/co19#2002)
2023-04-05 [email protected] Fixes dart-lang/co19#1990. Add HINT.UNREACHABLE_SWITCH_CASE to type_inference_A22_t01.dart (dart-lang/co19#1998)
2023-04-05 [email protected] Fixes dart-lang/co19#1996. Missed error expectation added (dart-lang/co19#2000)

Change-Id: I314668c107f134b2a813bc3ea356fd14ab7a3fb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293660
Reviewed-by: Alexander Thomas <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good
Projects
None yet
Development

No branches or pull requests

2 participants