-
Notifications
You must be signed in to change notification settings - Fork 1.7k
const_eval_throws_exception error #36511
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
Do we know if this is a regression? (2.3 is already past due.) |
Found the problem. It is not a regression. Explanation to follow. |
Ok, there is an error in @tvolkert's code, which the analyzer successfully detects. Unfortunately, the analyzer does a pretty horrible job of reporting where the error is (which is why I had to spend a few hours this morning sleuthing to even figure it out). To make matters worse, the VM fails to detect the error at all, making it seem like the analyzer is at fault. The error in @tvolkert's code is located here, in the constructor for the class
The line marked The reason the error is being reported at the site of the evaluation of The other problem that's happening here is that the VM does not properly detect the bug. It is allowing two enumerated values to be equality compared during constant evaluation without complaint. I'll file a separate bug report to track that. |
Is this a case where if we used |
@dnfield Yes! Sorry, I should have mentioned that. Switching to |
Thanks! This seems relatedto #29278 |
Consider the work-in-progress changes in flutter/flutter#30646 in which I change Flutter's
Row
widget to have aconst
constructor.In the associated test, I have the following code:
When run over that code, the analyzer produces the following error:
Yet when I run the test, it passes:
The text was updated successfully, but these errors were encountered: