@@ -29,6 +29,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
2929 conflictingKey = TransformSetErrorTemplate (
3030 name: 'conflicting_key' ,
3131 problemMessage: "The key '{0}' can't be used when '{1}' is also used." ,
32+ uniqueNameCheck: 'TransformSetErrorCode.conflicting_key' ,
3233 withArguments: _withArgumentsConflictingKey,
3334 expectedTypes: [ExpectedType .object, ExpectedType .object],
3435 );
@@ -38,6 +39,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
3839 TransformSetErrorWithoutArguments (
3940 name: 'expected_primary' ,
4041 problemMessage: "Expected either an identifier or a string literal." ,
42+ uniqueNameCheck: 'TransformSetErrorCode.expected_primary' ,
4143 expectedTypes: [],
4244 );
4345
@@ -51,6 +53,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
5153 name: 'incompatible_element_kind' ,
5254 problemMessage:
5355 "An element of kind '{0}' can't be replaced by an element of kind '{1}'." ,
56+ uniqueNameCheck: 'TransformSetErrorCode.incompatible_element_kind' ,
5457 withArguments: _withArgumentsIncompatibleElementKind,
5558 expectedTypes: [ExpectedType .object, ExpectedType .object],
5659 );
@@ -65,6 +68,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
6568 name: 'invalid_change_for_kind' ,
6669 problemMessage:
6770 "A change of type '{0}' can't be used for an element of kind '{1}'." ,
71+ uniqueNameCheck: 'TransformSetErrorCode.invalid_change_for_kind' ,
6872 withArguments: _withArgumentsInvalidChangeForKind,
6973 expectedTypes: [ExpectedType .object, ExpectedType .object],
7074 );
@@ -77,6 +81,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
7781 invalidCharacter = TransformSetErrorTemplate (
7882 name: 'invalid_character' ,
7983 problemMessage: "Invalid character '{0}'." ,
84+ uniqueNameCheck: 'TransformSetErrorCode.invalid_character' ,
8085 withArguments: _withArgumentsInvalidCharacter,
8186 expectedTypes: [ExpectedType .object],
8287 );
@@ -89,6 +94,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
8994 invalidKey = TransformSetErrorTemplate (
9095 name: 'invalid_key' ,
9196 problemMessage: "Keys must be of type 'String' but found the type '{0}'." ,
97+ uniqueNameCheck: 'TransformSetErrorCode.invalid_key' ,
9298 withArguments: _withArgumentsInvalidKey,
9399 expectedTypes: [ExpectedType .object],
94100 );
@@ -101,6 +107,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
101107 invalidParameterStyle = TransformSetErrorTemplate (
102108 name: 'invalid_parameter_style' ,
103109 problemMessage: "The parameter style must be one of the following: {0}." ,
110+ uniqueNameCheck: 'TransformSetErrorCode.invalid_parameter_style' ,
104111 withArguments: _withArgumentsInvalidParameterStyle,
105112 expectedTypes: [ExpectedType .object],
106113 );
@@ -111,6 +118,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
111118 name: 'invalid_required_if' ,
112119 problemMessage:
113120 "The key 'requiredIf' can only be used with optional named parameters." ,
121+ uniqueNameCheck: 'TransformSetErrorCode.invalid_required_if' ,
114122 expectedTypes: [],
115123 );
116124
@@ -129,6 +137,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
129137 name: 'invalid_value' ,
130138 problemMessage:
131139 "The value of '{0}' should be of type '{1}' but is of type '{2}'." ,
140+ uniqueNameCheck: 'TransformSetErrorCode.invalid_value' ,
132141 withArguments: _withArgumentsInvalidValue,
133142 expectedTypes: [
134143 ExpectedType .object,
@@ -146,6 +155,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
146155 invalidValueOneOf = TransformSetErrorTemplate (
147156 name: 'invalid_value_one_of' ,
148157 problemMessage: "The value of '{0}' must be one of the following: '{1}'." ,
158+ uniqueNameCheck: 'TransformSetErrorCode.invalid_value_one_of' ,
149159 withArguments: _withArgumentsInvalidValueOneOf,
150160 expectedTypes: [ExpectedType .object, ExpectedType .object],
151161 );
@@ -158,6 +168,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
158168 missingKey = TransformSetErrorTemplate (
159169 name: 'missing_key' ,
160170 problemMessage: "Missing the required key '{0}'." ,
171+ uniqueNameCheck: 'TransformSetErrorCode.missing_key' ,
161172 withArguments: _withArgumentsMissingKey,
162173 expectedTypes: [ExpectedType .object],
163174 );
@@ -170,6 +181,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
170181 missingOneOfMultipleKeys = TransformSetErrorTemplate (
171182 name: 'missing_one_of_multiple_keys' ,
172183 problemMessage: "Exactly one of the following keys must be provided: {0}." ,
184+ uniqueNameCheck: 'TransformSetErrorCode.missing_one_of_multiple_keys' ,
173185 withArguments: _withArgumentsMissingOneOfMultipleKeys,
174186 expectedTypes: [ExpectedType .object],
175187 );
@@ -179,6 +191,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
179191 TransformSetErrorWithoutArguments (
180192 name: 'missing_template_end' ,
181193 problemMessage: "Missing the end brace for the template." ,
194+ uniqueNameCheck: 'TransformSetErrorCode.missing_template_end' ,
182195 expectedTypes: [],
183196 );
184197
@@ -190,6 +203,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
190203 missingToken = TransformSetErrorTemplate (
191204 name: 'missing_token' ,
192205 problemMessage: "Expected to find {0}." ,
206+ uniqueNameCheck: 'TransformSetErrorCode.missing_token' ,
193207 withArguments: _withArgumentsMissingToken,
194208 expectedTypes: [ExpectedType .object],
195209 );
@@ -199,6 +213,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
199213 TransformSetErrorWithoutArguments (
200214 name: 'missing_uri' ,
201215 problemMessage: "At least one URI must be provided." ,
216+ uniqueNameCheck: 'TransformSetErrorCode.missing_uri' ,
202217 expectedTypes: [],
203218 );
204219
@@ -210,6 +225,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
210225 undefinedVariable = TransformSetErrorTemplate (
211226 name: 'undefined_variable' ,
212227 problemMessage: "The variable '{0}' isn't defined." ,
228+ uniqueNameCheck: 'TransformSetErrorCode.undefined_variable' ,
213229 withArguments: _withArgumentsUndefinedVariable,
214230 expectedTypes: [ExpectedType .object],
215231 );
@@ -222,6 +238,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
222238 unexpectedTransformSetToken = TransformSetErrorTemplate (
223239 name: 'unexpected_transform_set_token' ,
224240 problemMessage: "Didn't expect to find {0}." ,
241+ uniqueNameCheck: 'TransformSetErrorCode.unexpected_transform_set_token' ,
225242 withArguments: _withArgumentsUnexpectedTransformSetToken,
226243 expectedTypes: [ExpectedType .object],
227244 );
@@ -234,6 +251,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
234251 unknownAccessor = TransformSetErrorTemplate (
235252 name: 'unknown_accessor' ,
236253 problemMessage: "The accessor '{0}' is invalid." ,
254+ uniqueNameCheck: 'TransformSetErrorCode.unknown_accessor' ,
237255 withArguments: _withArgumentsUnknownAccessor,
238256 expectedTypes: [ExpectedType .object],
239257 );
@@ -246,6 +264,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
246264 unsupportedKey = TransformSetErrorTemplate (
247265 name: 'unsupported_key' ,
248266 problemMessage: "The key '{0}' isn't supported." ,
267+ uniqueNameCheck: 'TransformSetErrorCode.unsupported_key' ,
249268 withArguments: _withArgumentsUnsupportedKey,
250269 expectedTypes: [ExpectedType .object],
251270 );
@@ -257,6 +276,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
257276 problemMessage:
258277 "The key 'static' is only supported for elements in a class, enum, "
259278 "extension, or mixin." ,
279+ uniqueNameCheck: 'TransformSetErrorCode.unsupported_static' ,
260280 expectedTypes: [],
261281 );
262282
@@ -265,6 +285,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
265285 TransformSetErrorWithoutArguments (
266286 name: 'unsupported_version' ,
267287 problemMessage: "Only version '1' is supported at this time." ,
288+ uniqueNameCheck: 'TransformSetErrorCode.unsupported_version' ,
268289 expectedTypes: [],
269290 );
270291
@@ -277,6 +298,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
277298 wrongToken = TransformSetErrorTemplate (
278299 name: 'wrong_token' ,
279300 problemMessage: "Expected to find {0}, but found {1}." ,
301+ uniqueNameCheck: 'TransformSetErrorCode.wrong_token' ,
280302 withArguments: _withArgumentsWrongToken,
281303 expectedTypes: [ExpectedType .object, ExpectedType .object],
282304 );
@@ -289,6 +311,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
289311 yamlSyntaxError = TransformSetErrorTemplate (
290312 name: 'yaml_syntax_error' ,
291313 problemMessage: "Parse error: {0}" ,
314+ uniqueNameCheck: 'TransformSetErrorCode.yaml_syntax_error' ,
292315 withArguments: _withArgumentsYamlSyntaxError,
293316 expectedTypes: [ExpectedType .object],
294317 );
@@ -301,6 +324,7 @@ class TransformSetErrorCode extends DiagnosticCodeWithExpectedTypes {
301324 super .hasPublishedDocs = false ,
302325 super .isUnresolvedIdentifier = false ,
303326 String ? uniqueName,
327+ required String super .uniqueNameCheck,
304328 required super .expectedTypes,
305329 }) : super (
306330 type: DiagnosticType .COMPILE_TIME_ERROR ,
@@ -452,6 +476,7 @@ final class TransformSetErrorTemplate<T extends Function>
452476 super .hasPublishedDocs = false ,
453477 super .isUnresolvedIdentifier = false ,
454478 super .uniqueName,
479+ required super .uniqueNameCheck,
455480 required super .expectedTypes,
456481 required this .withArguments,
457482 });
@@ -467,6 +492,7 @@ final class TransformSetErrorWithoutArguments extends TransformSetErrorCode
467492 super .hasPublishedDocs = false ,
468493 super .isUnresolvedIdentifier = false ,
469494 super .uniqueName,
495+ required super .uniqueNameCheck,
470496 required super .expectedTypes,
471497 });
472498}
0 commit comments