Skip to content

Commit 2801518

Browse files
bwilkersonCommit Queue
authored andcommitted
Add experiment keys to experiment-related diagnostics
In a recent discussion we decided to add an `experiment` key to the entries in the analyzer's `messages.yaml` file with the same semantics as they have in the front-end messages file. This is an initial attempt to add them. I'm reasonably confident that all of the markes diagnostics are related to the specified experiment, but there might well be others. I'm happy to update this CL to capture those as well, but we can always add the map entry later as we discover diagnostics that were missed. Change-Id: I31ec94bae905828e64a1769fdf905ef7a19a8d11 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430120 Reviewed-by: Kallen Tu <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 57174f5 commit 2801518

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pkg/analyzer/messages.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,24 +1148,28 @@ CompileTimeErrorCode:
11481148
}
11491149
```
11501150
AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT:
1151+
experiment: augmentations
11511152
problemMessage: The augmentation has an 'extends' clause, but an augmentation target already includes an 'extends' clause and it isn't allowed to be repeated or changed.
11521153
correctionMessage: Try removing the 'extends' clause, either here or in the augmentation target.
11531154
hasPublishedDocs: false
11541155
AUGMENTATION_MODIFIER_EXTRA:
1156+
experiment: augmentations
11551157
problemMessage: The augmentation has the '{0}' modifier that the declaration doesn't have.
11561158
correctionMessage: Try removing the '{0}' modifier, or adding it to the declaration.
11571159
hasPublishedDocs: false
11581160
comment: |-
11591161
Parameters:
11601162
0: the lexeme of the modifier.
11611163
AUGMENTATION_MODIFIER_MISSING:
1164+
experiment: augmentations
11621165
problemMessage: The augmentation is missing the '{0}' modifier that the declaration has.
11631166
correctionMessage: Try adding the '{0}' modifier, or removing it from the declaration.
11641167
hasPublishedDocs: false
11651168
comment: |-
11661169
Parameters:
11671170
0: the lexeme of the modifier.
11681171
AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND:
1172+
experiment: augmentations
11691173
problemMessage: Can't augment a {0} with a {1}.
11701174
correctionMessage: Try changing the augmentation to match the declaration kind.
11711175
hasPublishedDocs: false
@@ -1174,30 +1178,37 @@ CompileTimeErrorCode:
11741178
0: the name of the declaration kind.
11751179
1: the name of the augmentation kind.
11761180
AUGMENTATION_TYPE_PARAMETER_BOUND:
1181+
experiment: augmentations
11771182
problemMessage: The augmentation type parameter must have the same bound as the corresponding type parameter of the declaration.
11781183
correctionMessage: Try changing the augmentation to match the declaration type parameters.
11791184
hasPublishedDocs: false
11801185
AUGMENTATION_TYPE_PARAMETER_COUNT:
1186+
experiment: augmentations
11811187
problemMessage: The augmentation must have the same number of type parameters as the declaration.
11821188
correctionMessage: Try changing the augmentation to match the declaration type parameters.
11831189
hasPublishedDocs: false
11841190
AUGMENTATION_TYPE_PARAMETER_NAME:
1191+
experiment: augmentations
11851192
problemMessage: The augmentation type parameter must have the same name as the corresponding type parameter of the declaration.
11861193
correctionMessage: Try changing the augmentation to match the declaration type parameters.
11871194
hasPublishedDocs: false
11881195
AUGMENTATION_WITHOUT_DECLARATION:
1196+
experiment: augmentations
11891197
problemMessage: The declaration being augmented doesn't exist.
11901198
correctionMessage: Try changing the augmentation to match an existing declaration.
11911199
hasPublishedDocs: false
11921200
AUGMENTED_EXPRESSION_IS_NOT_SETTER:
1201+
experiment: augmentations
11931202
problemMessage: The augmented declaration is not a setter, it can't be used to write a value.
11941203
correctionMessage: Try assigning a value to a setter.
11951204
hasPublishedDocs: false
11961205
AUGMENTED_EXPRESSION_IS_SETTER:
1206+
experiment: augmentations
11971207
problemMessage: The augmented declaration is a setter, it can't be used to read a value.
11981208
correctionMessage: Try assigning a value to the augmented setter.
11991209
hasPublishedDocs: false
12001210
AUGMENTED_EXPRESSION_NOT_OPERATOR:
1211+
experiment: augmentations
12011212
problemMessage: The enclosing augmentation doesn't augment the operator '{0}'.
12021213
correctionMessage: Try augmenting or invoking the correct operator.
12031214
hasPublishedDocs: false
@@ -3865,10 +3876,12 @@ CompileTimeErrorCode:
38653876
Parameters:
38663877
0: the name of the duplicate entity
38673878
DOT_SHORTHAND_MISSING_CONTEXT:
3879+
experiment: dot-shorthands
38683880
problemMessage: "A dot shorthand can't be used where there is no context type."
38693881
hasPublishedDocs: false
38703882
DOT_SHORTHAND_UNDEFINED_GETTER:
38713883
sharedName: DOT_SHORTHAND_UNDEFINED_MEMBER
3884+
experiment: dot-shorthands
38723885
problemMessage: "The static getter '{0}' isn't defined for the context type '{1}'."
38733886
correctionMessage: "Try correcting the name to the name of an existing static getter, or defining a getter or field named '{0}'."
38743887
hasPublishedDocs: false
@@ -3878,6 +3891,7 @@ CompileTimeErrorCode:
38783891
1: the name of the enclosing type where the getter is being looked for
38793892
DOT_SHORTHAND_UNDEFINED_INVOCATION:
38803893
sharedName: DOT_SHORTHAND_UNDEFINED_MEMBER
3894+
experiment: dot-shorthands
38813895
problemMessage: "The static method or constructor '{0}' isn't defined for the type '{1}'."
38823896
correctionMessage: "Try correcting the name to the name of an existing static method or constructor, or defining a static method or constructor named '{0}'."
38833897
hasPublishedDocs: false
@@ -18402,6 +18416,7 @@ CompileTimeErrorCode:
1840218416
```
1840318417
WRONG_NUMBER_OF_TYPE_ARGUMENTS_DOT_SHORTHAND_CONSTRUCTOR:
1840418418
sharedName: WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
18419+
experiment: dot-shorthands
1840518420
problemMessage: "The constructor '{0}.{1}` doesn't have type parameters."
1840618421
correctionMessage: Try removing the type arguments, or adding a class name, followed by the type arguments, then the constructor name.
1840718422
hasPublishedDocs: true
@@ -21500,6 +21515,7 @@ ParserErrorCode:
2150021515
correctionMessage: "Try removing the keyword 'covariant'."
2150121516
hasPublishedDocs: false
2150221517
DECLARATION_NAMED_AUGMENTED_INSIDE_AUGMENTATION:
21518+
experiment: augmentations
2150321519
problemMessage: "The identifier 'augmented' has a special meaning inside augmenting declarations."
2150421520
correctionMessage: "Try using a different name."
2150521521
hasPublishedDocs: false
@@ -21665,6 +21681,7 @@ ParserErrorCode:
2166521681
correctionMessage: Try converting the body to a block.
2166621682
hasPublishedDocs: false
2166721683
INVALID_USE_OF_IDENTIFIER_AUGMENTED:
21684+
experiment: augmentations
2166821685
problemMessage: The identifier 'augmented' can only be used to reference the augmented declaration inside an augmentation.
2166921686
correctionMessage: Try using a different identifier.
2167021687
hasPublishedDocs: false

0 commit comments

Comments
 (0)