Skip to content

Commit 3369772

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Switch error code references in messages.yaml to camelCase
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/444921, which renamed analyzer error codes from SCREAMING_CAPS conventions to camelCase conventions. That CL left a few deprecated error codes in place because they were referred to in comments in the `messages.yaml` file, and those references couldn't be fixed in an automated fashion. This CL cleans up the references in `messages.yaml` to use the new camelCase constants, and removes the deprecated SCREAMING_CAPS constants that are no longer needed. Change-Id: I6a6a696406efa02d73775d1a8e0defa5a0e8e39b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445105 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Auto-Submit: Paul Berry <[email protected]>
1 parent 8e85492 commit 3369772

File tree

4 files changed

+12
-36
lines changed

4 files changed

+12
-36
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,6 @@ class ParserErrorCode extends DiagnosticCode {
728728
"Expected a type name.",
729729
);
730730

731-
@Deprecated("Please use experimentNotEnabled")
732-
static const ParserErrorCode EXPERIMENT_NOT_ENABLED = experimentNotEnabled;
733-
734731
static const ParserErrorCode experimentNotEnabled = ParserErrorCode(
735732
'EXPERIMENT_NOT_ENABLED',
736733
"This requires the '{0}' language feature to be enabled.",

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

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,10 +3148,6 @@ class CompileTimeErrorCode extends DiagnosticCode {
31483148
withArguments: _withArgumentsInitializingFormalForNonExistentField,
31493149
);
31503150

3151-
@Deprecated("Please use instanceAccessToStaticMember")
3152-
static const CompileTimeErrorCode INSTANCE_ACCESS_TO_STATIC_MEMBER =
3153-
instanceAccessToStaticMember;
3154-
31553151
/// Parameters:
31563152
/// String p0: the name of the static member
31573153
/// String p1: the kind of the static member (field, getter, setter, or
@@ -3283,9 +3279,6 @@ class CompileTimeErrorCode extends DiagnosticCode {
32833279
withArguments: _withArgumentsInterfaceClassExtendedOutsideOfLibrary,
32843280
);
32853281

3286-
@Deprecated("Please use invalidOverride")
3287-
static const CompileTimeErrorCode INVALID_OVERRIDE = invalidOverride;
3288-
32893282
/// No parameters.
32903283
static const CompileTimeErrorWithoutArguments
32913284
invalidAnnotation = CompileTimeErrorWithoutArguments(
@@ -3536,7 +3529,7 @@ class CompileTimeErrorCode extends DiagnosticCode {
35363529
);
35373530

35383531
/// The parameters of this error code must be kept in sync with those of
3539-
/// [CompileTimeErrorCode.INVALID_OVERRIDE].
3532+
/// [CompileTimeErrorCode.invalidOverride].
35403533
///
35413534
/// Parameters:
35423535
/// Object p0: the name of the declared member that is not a valid override.
@@ -3562,7 +3555,7 @@ class CompileTimeErrorCode extends DiagnosticCode {
35623555
);
35633556

35643557
/// The parameters of this error code must be kept in sync with those of
3565-
/// [CompileTimeErrorCode.INVALID_OVERRIDE].
3558+
/// [CompileTimeErrorCode.invalidOverride].
35663559
///
35673560
/// Parameters:
35683561
/// Object p0: the name of the declared setter that is not a valid override.
@@ -6278,10 +6271,6 @@ class CompileTimeErrorCode extends DiagnosticCode {
62786271
withArguments: _withArgumentsTopLevelCycle,
62796272
);
62806273

6281-
@Deprecated("Please use typeArgumentNotMatchingBounds")
6282-
static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
6283-
typeArgumentNotMatchingBounds;
6284-
62856274
/// No parameters.
62866275
static const CompileTimeErrorWithoutArguments
62876276
typeAliasCannotReferenceItself = CompileTimeErrorWithoutArguments(
@@ -6340,7 +6329,7 @@ class CompileTimeErrorCode extends DiagnosticCode {
63406329
hasPublishedDocs: true,
63416330
);
63426331

6343-
/// See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
6332+
/// See [CompileTimeErrorCode.typeArgumentNotMatchingBounds].
63446333
///
63456334
/// Parameters:
63466335
/// String p0: the name of the type parameter
@@ -6492,9 +6481,6 @@ class CompileTimeErrorCode extends DiagnosticCode {
64926481
uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH',
64936482
);
64946483

6495-
@Deprecated("Please use undefinedClass")
6496-
static const CompileTimeErrorCode UNDEFINED_CLASS = undefinedClass;
6497-
64986484
/// Parameters:
64996485
/// String p0: the name of the annotation
65006486
static const CompileTimeErrorTemplate<
@@ -6526,7 +6512,7 @@ class CompileTimeErrorCode extends DiagnosticCode {
65266512
withArguments: _withArgumentsUndefinedClass,
65276513
);
65286514

6529-
/// Same as [CompileTimeErrorCode.UNDEFINED_CLASS], but to catch using
6515+
/// Same as [CompileTimeErrorCode.undefinedClass], but to catch using
65306516
/// "boolean" instead of "bool" in order to improve the correction message.
65316517
///
65326518
/// Parameters:
@@ -6945,7 +6931,7 @@ class CompileTimeErrorCode extends DiagnosticCode {
69456931
withArguments: _withArgumentsUndefinedSuperSetter,
69466932
);
69476933

6948-
/// This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
6934+
/// This is a specialization of [instanceAccessToStaticMember] that is used
69496935
/// when we are able to find the name defined in a supertype. It exists to
69506936
/// provide a more informative error message.
69516937
///
@@ -11470,7 +11456,7 @@ class WarningCode extends DiagnosticCode {
1147011456
withArguments: _withArgumentsReturnTypeInvalidForCatchError,
1147111457
);
1147211458

11473-
/// There is also a [ParserErrorCode.EXPERIMENT_NOT_ENABLED] code which
11459+
/// There is also a [ParserErrorCode.experimentNotEnabled] code which
1147411460
/// catches some cases of constructor tearoff features (like
1147511461
/// `List<int>.filled;`). Other constructor tearoff cases are not realized
1147611462
/// until resolution (like `List.filled;`).

pkg/analyzer/messages.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8749,7 +8749,7 @@ CompileTimeErrorCode:
87498749
hasPublishedDocs: true
87508750
comment: |-
87518751
The parameters of this error code must be kept in sync with those of
8752-
[CompileTimeErrorCode.INVALID_OVERRIDE].
8752+
[CompileTimeErrorCode.invalidOverride].
87538753
documentation: |-
87548754
#### Description
87558755

@@ -8844,7 +8844,7 @@ CompileTimeErrorCode:
88448844
hasPublishedDocs: true
88458845
comment: |-
88468846
The parameters of this error code must be kept in sync with those of
8847-
[CompileTimeErrorCode.INVALID_OVERRIDE].
8847+
[CompileTimeErrorCode.invalidOverride].
88488848
INVALID_INLINE_FUNCTION_TYPE:
88498849
parameters: none
88508850
problemMessage: "Inline function types can't be used for parameters in a generic function type."
@@ -16375,7 +16375,7 @@ CompileTimeErrorCode:
1637516375
correctionMessage: "Try using a type that is the same as or a subclass of '#p1'."
1637616376
hasPublishedDocs: true
1637716377
comment: |-
16378-
See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
16378+
See [CompileTimeErrorCode.typeArgumentNotMatchingBounds].
1637916379
documentation: |-
1638016380
#### Description
1638116381

@@ -16702,7 +16702,7 @@ CompileTimeErrorCode:
1670216702
isUnresolvedIdentifier: true
1670316703
hasPublishedDocs: true
1670416704
comment: |-
16705-
Same as [CompileTimeErrorCode.UNDEFINED_CLASS], but to catch using
16705+
Same as [CompileTimeErrorCode.undefinedClass], but to catch using
1670616706
"boolean" instead of "bool" in order to improve the correction message.
1670716707
UNDEFINED_CONSTRUCTOR_IN_INITIALIZER:
1670816708
parameters:
@@ -17714,7 +17714,7 @@ CompileTimeErrorCode:
1771417714
correctionMessage: "Try adding '#p0.' before the name."
1771517715
hasPublishedDocs: true
1771617716
comment: |-
17717-
This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
17717+
This is a specialization of [instanceAccessToStaticMember] that is used
1771817718
when we are able to find the name defined in a supertype. It exists to
1771917719
provide a more informative error message.
1772017720
documentation: |-
@@ -27394,7 +27394,7 @@ WarningCode:
2739427394
correctionMessage: "Try updating your pubspec.yaml to set the minimum SDK constraint to 2.15 or higher, and running 'pub get'."
2739527395
hasPublishedDocs: true
2739627396
comment: |-
27397-
There is also a [ParserErrorCode.EXPERIMENT_NOT_ENABLED] code which
27397+
There is also a [ParserErrorCode.experimentNotEnabled] code which
2739827398
catches some cases of constructor tearoff features (like
2739927399
`List<int>.filled;`). Other constructor tearoff cases are not realized
2740027400
until resolution (like `List.filled;`).

pkg/analyzer/tool/messages/error_code_info.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ const List<ErrorClassInfo> errorClasses = [
3636
file: codesFile,
3737
name: 'CompileTimeErrorCode',
3838
type: 'COMPILE_TIME_ERROR',
39-
deprecatedSnakeCaseNames: {
40-
'INSTANCE_ACCESS_TO_STATIC_MEMBER', // Referenced by `messages.yaml`.
41-
'INVALID_OVERRIDE', // Referenced by `messages.yaml`.
42-
'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', // Referenced by `messages.yaml`.
43-
'UNDEFINED_CLASS', // Referenced by `messages.yaml`.
44-
},
4539
),
4640
ErrorClassInfo(
4741
file: scannerErrorFile,
@@ -73,7 +67,6 @@ const List<ErrorClassInfo> errorClasses = [
7367
severity: 'ERROR',
7468
includeCfeMessages: true,
7569
deprecatedSnakeCaseNames: {
76-
'EXPERIMENT_NOT_ENABLED', // Referenced by `messages.yaml`.
7770
'UNEXPECTED_TOKEN', // Referenced by `package:dart_style`.
7871
},
7972
),

0 commit comments

Comments
 (0)