-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Defining a variable with the name 'name' in an enum causes a syntax error in Flutter Web #49021
Comments
Perhaps a dart2js or DDC issue? |
Fixed in https://dart-review.googlesource.com/c/sdk/+/245082 Interestingly this was a bug in the CFE, but since enum constructors are never invoked by the user, the VM wasn't compiling them. That's why it only showed up on the web. |
Actually, DDC might need to separately fix this issue. I don't know enough about DDC to know for sure (not sure if they use the same front end), so I'll leave this issue open for now. |
Apparently DDC uses the same CFE as the VM and dart2js, so my CFE fix should have fixed the bug for DDC too. |
Describe the issue
After updating to Dart 2.17 and Flutter 3.0 I made use of the new capabilities of Enums. However, the explicit creation of a variable with the name 'name' causes an 'Identifier 'name' has already been declared' in the Chrome console after running the Flutter Web application.
To Reproduce
Expected behavior
Flutter Web application will not be executed. Google Chrome console shows 'Uncaught SyntaxError: Identifier 'name' has already been declared.
Additional context
Flutter for mobile still works fine. The issue is only related to Flutter Web.
The text was updated successfully, but these errors were encountered: