-
Notifications
You must be signed in to change notification settings - Fork 28
#2420. Add more exhaustiveness tests #2513
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of comments on this one. ;-)
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/static_analysis_extension_types_A33_t03.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Please take another look
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/static_analysis_extension_types_A33_t03.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still really tricky. The difficulties arise because some tests claim that they are about "flow analysis does not use erasure...", and that's a really complex property to test.
The simple case that I can think of is that some expressions of type ET
are erased to int
for the purpose of checking control flow based on run-time tests/checks, and we just need to make sure that the same expressions aren't erased when we perform normal type checking.
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partially updated. Github doesn't show me all of the threads on one page therefore I'll comment here the others as well.
exhaustiveness_flow_analysis_A01_t01.dart
updated to check that there is no erasure by calling member of an extension type- Yes, we really have tests that check that [extension types] Switch statement is not exhaustive on sealed class sdk#54444 is fixed, for example https://github.com/dart-lang/co19/tree/master/LanguageFeatures/Extension-types/exhaustiveness_variable_A01_t08.dart. So I need to rewrite
exhaustiveness_flow_analysis_A02_t01.dart
. But I don't quite understand your suggestion to use a not exhaustive type and not exhaustive switch statement. Could you, please, provide an example? - Added
exhaustiveness_sealed_A03_t02.dart
containing "not possible nut possible" test
Do I forget anything? Please review and advice with p.2.
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/static_analysis_extension_types_A33_t03.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Just a couple of typos left.
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A02_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Extension-types/exhaustiveness_flow_analysis_A01_t01.dart
Outdated
Show resolved
Hide resolved
LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_sealed_A03_t01.dart
Outdated
Show resolved
Hide resolved
Typos and formatting fixed. I also deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
2024-02-02 [email protected] Fix dart-lang/co19#2517. Fix wrong test, add experimental flags (dart-lang/co19#2518) 2024-02-02 [email protected] Fix dart-lang/co19#2490. Update incompatible with await tests according to the changed rule (dart-lang/co19#2516) 2024-02-01 [email protected] dart-lang/co19#2420. Add more exhaustiveness tests (dart-lang/co19#2513) 2024-01-31 [email protected] dart-lang/co19#2446. Add additional test for cast pattern (dart-lang/co19#2514) 2024-01-30 [email protected] dart-lang/co19#1399. Add more tests for records (dart-lang/co19#2511) 2024-01-30 [email protected] dart-lang/co19#2485. Update map and list constant literals tests. Add parenthesized for records (dart-lang/co19#2512) 2024-01-29 [email protected] Fixes dart-lang/co19#2490. Add more await tests for extension types (dart-lang/co19#2500) 2024-01-29 [email protected] dart-lang/co19#2119. Fix typo in Subtyping tests description (dart-lang/co19#2510) 2024-01-29 [email protected] Fixes dart-lang/co19#2505. Add more tests for `call` member (dart-lang/co19#2506) 2024-01-29 [email protected] dart-lang/co19#2420. Add cast-pattern tests for extension types (dart-lang/co19#2458) Change-Id: I631705a013f9a77910ae0f0be5a9fea01e7c719f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350240 Reviewed-by: Erik Ernst <[email protected]> Commit-Queue: Erik Ernst <[email protected]> Reviewed-by: William Hesse <[email protected]>
Add more exhaustiveness tests
Add more exhaustiveness tests
No description provided.