-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
dartanalyzer: 'Evaluation of this constant expression throws an exception' when creating a simple rectangle #43462
Comments
Interesting. Sounds like an analyzer error. |
It seems to me that there are two issues.
@lrhn @eernstg @leafpetersen does this sound right to you? |
I would expect every term |
R=brianwilkerson@google.com Bug: #43462 Change-Id: I82200c06b1a77f634b7c7f30fd3ad7e10eb01ad4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163280 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov That seems like a nice behavior if we can achieve it. |
…able since 2.0.0 See dart-lang/language#286 (comment) and #43462 Change-Id: Ib8c37a2b5e3ce6c737e496bf285d946baf3a41d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163401 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
See dart-lang/language#286 (comment) and #43462 Change-Id: Id844473e0cb371ffc4470a18993c66c8ad0427e9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163503 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
Both (1) and (2) from #43462 (comment) were done. |
Not really a bug but a change in behavior, and the fix is easy in a project running into this but finding the reason takes some time as it's not obvious, so this is more of a FYI for people running into the same bug. I am on
Dart SDK version: 2.10.0-110.0.dev (dev) (Wed Sep 9 17:51:43 2020 -0700) on "windows_x64"
and I'm not sure when it started appearing.The dartanalyzer will error on this code
If the sdk in pubspec.yaml has a lower limit below 2.5, like
sdk: '>=2.4.0 <3.0.0'
then this error will be reported:With a lower sdk limit of at least 2.5.0 this won't be reported as an error any longer.
Maybe because 2.5.0 introduced new allowed operations in constant expressions, like
And Rectangle recently (in june) got such a change (but using dynamic instead of T).
The text was updated successfully, but these errors were encountered: