Skip to content

Commit

Permalink
Modify error message for const (ASSIGNMENT_TO_CONST)
Browse files Browse the repository at this point in the history
Closes #56953

GitOrigin-RevId: 5452a16
Change-Id: Icc1811b39a10cd0fe5b9155c52ef4f133cfc7f14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391489
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
  • Loading branch information
Frankdroid7 authored and Commit Queue committed Feb 21, 2025
1 parent 115dcc9 commit 3c792ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/error/codes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class CompileTimeErrorCode extends ErrorCode {
/// No parameters.
static const CompileTimeErrorCode ASSIGNMENT_TO_CONST = CompileTimeErrorCode(
'ASSIGNMENT_TO_CONST',
"Constant variables can't be assigned a value.",
"Constant variables can't be assigned a value after initialization.",
correctionMessage:
"Try removing the assignment, or remove the modifier 'const' from the "
"variable.",
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ CompileTimeErrorCode:
}
```
ASSIGNMENT_TO_CONST:
problemMessage: "Constant variables can't be assigned a value."
problemMessage: "Constant variables can't be assigned a value after initialization."
correctionMessage: "Try removing the assignment, or remove the modifier 'const' from the variable."
hasPublishedDocs: true
comment: No parameters.
Expand Down

0 comments on commit 3c792ec

Please sign in to comment.