-
Notifications
You must be signed in to change notification settings - Fork 1.7k
CFE produces the following error in flutter code when constant_update_2018 flag is turned on #36564
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
Comments
Was able to reduce the test as follows
This produces the following error when constant__update_2018 flag is used
Without the flag it runs fine:
|
This is invalid code, that's why the analyzer is told to shut up with The error message we give seems kind of cryptic, but the important part is that the spec requires "receiver ... of type 'Null', 'bool', 'int', 'double', or 'String', but was of type 'FlutterLogoStyle'". If we had a spec change, it would be easy enough to change the constant evaluator. /cc @lrhn |
This is really a duplicate of #26980. |
The front-end constant evaluator fixes a bug in the VM (that it accepted this code). Flutter will see it as a regression because the Dart platform they were using previously allowed this code. This is despite the fact that it was knowingly exploiting a VM bug. I'm not sure how we want to proceed from here. The workaround in Flutter code is to use I talked to @lrhn and we're not going to get a spec update for this issue for Dart 2.3. We could provide a flag that the VM target could use to instruct us to be bug compatible with the previous behavior, and allow this comparison. I'd like to do that as a very last resort and try to fix Flutter first. |
FYI, some related bugs:
|
@a-siva I see that your pull request was merged, is it OK to close this issue now? |
Flutter code has been fixed. |
Uh oh!
There was an error while loading. Please reload this page.
Turning on constant_update_2018 flag and running flutter tests produces the following error:
The relevant code is as follows:
The text was updated successfully, but these errors were encountered: