Skip to content

Commit 3c792ec

Browse files
Frankdroid7Commit Queue
authored andcommitted
Modify error message for const (ASSIGNMENT_TO_CONST)
Closes #56953 GitOrigin-RevId: 5452a16 Change-Id: Icc1811b39a10cd0fe5b9155c52ef4f133cfc7f14 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391489 Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Phil Quitslund <[email protected]>
1 parent 115dcc9 commit 3c792ec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/analyzer/lib/src/error/codes.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class CompileTimeErrorCode extends ErrorCode {
156156
/// No parameters.
157157
static const CompileTimeErrorCode ASSIGNMENT_TO_CONST = CompileTimeErrorCode(
158158
'ASSIGNMENT_TO_CONST',
159-
"Constant variables can't be assigned a value.",
159+
"Constant variables can't be assigned a value after initialization.",
160160
correctionMessage:
161161
"Try removing the assignment, or remove the modifier 'const' from the "
162162
"variable.",

pkg/analyzer/messages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ CompileTimeErrorCode:
788788
}
789789
```
790790
ASSIGNMENT_TO_CONST:
791-
problemMessage: "Constant variables can't be assigned a value."
791+
problemMessage: "Constant variables can't be assigned a value after initialization."
792792
correctionMessage: "Try removing the assignment, or remove the modifier 'const' from the variable."
793793
hasPublishedDocs: true
794794
comment: No parameters.

0 commit comments

Comments
 (0)