Extra error messages when compiling switch_expression_using_statement_syntax_error_test.dart
for web
#51943
Labels
area-web-js
Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
In https://dart-review.googlesource.com/c/sdk/+/293200 (Patterns parsing: recover when switch statement syntax used for switch expressions.), I've added a test
tests/language/patterns/switch_expression_using_statement_syntax_error_test.dart
to verify that error recovery does a good job of handling incorrect switch expression syntax.When I ran
pkg/test_runner/tool/update_static_error_tests.dart
to automatically update the error expectations for that test, I was surprised to see some errors that are particular to theweb
platform:(I've left out the
analyzer
andcfe
error expectations for brevity).I'm not sure why the web platform is getting these extra errors, however after some manual experimenting, I'm guessing it may have something to do with the fact that my error recovery technique creates a wildcard pattern whose name token is
default
. I wonder if for some reason the web compiler gets confused by this, though it seems strange because the name token shouldn't have any effect on semantics.The text was updated successfully, but these errors were encountered: