-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
cfe-dysfunctionalitiesIssues for the CFE not behaving as intendedIssues for the CFE not behaving as intendedlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
The below works well in VM but produces an error in the analyzer.
const answer = "42"!; // Analyzer error. Const variables must be initialized with a constant value.
main() {
print(answer);
}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"
Metadata
Metadata
Assignees
Labels
cfe-dysfunctionalitiesIssues for the CFE not behaving as intendedIssues for the CFE not behaving as intendedlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)