-
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
Analyzer doesn't allow !
selector in constants
#59800
Comments
I'd be fine with (I did find a section saying that the section on \item An expression of the form \code{$e$\,\,as\,\,$T$} or \code{$e$\,\,is\,\,$T$} is potentially constant if $e$ is a potentially constant expression and $T$ is a potentially constant type expression, and it is further constant if $e$ is constant. That should also say "and |
Same here, I can't see any justification for the claim that a constant expression can contain a selector of the form @sgrekhov, did you find anything to the contrary somewhere? This means that the CFE should be modified to report an error. |
@keertip, I adjusted the labels. PTAL if you disagree. |
We could consider generalizing constant expressions to include this case, but that would be a fresh language repo issue, so I won't proceed with anything of that nature here. |
Static access shorthand proposal mentions this in an informal section. |
Good catch! dart-lang/language#4226. |
The below works well in VM but produces an error in the analyzer.
Constant expression allows
!
selector, therefore, I believe, it's an analyzer issue.@lrhn @eernstg please confirm.
Dart SDK version: 3.7.0-274.0.dev (dev) (Thu Dec 19 20:06:50 2024 -0800) on "windows_x64"
The text was updated successfully, but these errors were encountered: