Skip to content

Runtime errors potentially due to incomplete pattern desugaring in switch statements #50783

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
chloestefantsova opened this issue Dec 20, 2022 · 5 comments
Labels
legacy-area-front-end Legacy: Use area-dart-model instead.

Comments

@chloestefantsova
Copy link
Contributor

The following tests started surfacing runtime errors after the switch-pattern desugaring was partially introduced. It's most likely that the incomplete desugaring is the root of the issue, and it will be resolved eventually as desugaring becomes more complete.

  • co19/LanguageFeatures/Patterns/list_A01_t02 (additionally, possibly 'records' not enabled on dart2js tests)
  • co19/LanguageFeatures/Patterns/logical_and_A06_t01
  • co19/LanguageFeatures/Patterns/logical_or_A02_t02
  • co19/LanguageFeatures/Patterns/logical_or_A05_t01
  • co19/LanguageFeatures/Patterns/wildcards_A01_t04

The error was encountered during work on https://dart-review.googlesource.com/c/sdk/+/276524.

This issue is assigned label area-front-end tentatively, and it needs further investigation, and possibly reassignment of the tags.

@chloestefantsova chloestefantsova added the legacy-area-front-end Legacy: Use area-dart-model instead. label Dec 20, 2022
@alexmarkov
Copy link
Contributor

I can confirm that the following tests fail because Object pattern is not implemented yet:

co19/LanguageFeatures/Patterns/list_A01_t02
co19/LanguageFeatures/Patterns/logical_and_A06_t01
co19/LanguageFeatures/Patterns/logical_or_A05_t01
co19/LanguageFeatures/Patterns/wildcards_A01_t04

co19/LanguageFeatures/Patterns/logical_or_A02_t02 fails for another reason: #50797.

@chloestefantsova
Copy link
Contributor Author

More of the failing tests for the same reason.

  • tests/co19/src/LanguageFeatures/Patterns/list_A04_t05.dart
  • co19/LanguageFeatures/Patterns/record_A01_t01
  • co19/LanguageFeatures/Patterns/record_A01_t02
  • co19/LanguageFeatures/Patterns/record_A01_t03
  • co19/LanguageFeatures/Patterns/record_A01_t04

These are detected by the try bots on the following CL: https://dart-review.googlesource.com/c/sdk/+/276940.

@chloestefantsova
Copy link
Contributor Author

One more example:

  • co19/LanguageFeatures/Patterns/wildcards_A01_t01

@chloestefantsova
Copy link
Contributor Author

More of the test failing due to the pattern desugaring being incomplete:

  • co19/LanguageFeatures/Patterns/map_A04_t02
  • co19/LanguageFeatures/Patterns/map_A05_t01
  • co19/LanguageFeatures/Patterns/object_A01_t01
  • co19/LanguageFeatures/Patterns/object_A02_t01
  • co19/LanguageFeatures/Patterns/record_A01_t07
  • co19/LanguageFeatures/Patterns/record_A01_t08
  • co19/LanguageFeatures/Patterns/variable_A02_t01
  • co19/LanguageFeatures/Patterns/variable_A02_t03
  • co19/LanguageFeatures/Patterns/variable_A02_t04
  • co19/LanguageFeatures/Patterns/variable_A02_t06

@johnniwinther johnniwinther added Epic and removed Epic labels Jan 5, 2023
@chloestefantsova
Copy link
Contributor Author

One of the tests tracked in this issue fails with a missed compile-time error, and all other pass. I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

3 participants