Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 221483002: Fix for translation of \!= to \!identical(), but use == and \!= for Enum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.error; 8 library engine.error;
9 9
10 import 'java_core.dart'; 10 import 'java_core.dart';
11 import 'source.dart'; 11 import 'source.dart';
12 import 'scanner.dart' show Token; 12 import 'scanner.dart' show Token;
13 import 'ast.dart' show AstNode; 13 import 'ast.dart' show AstNode;
14 import 'element.dart' show Element; 14 import 'element.dart' show Element;
15 15
16 /** 16 /**
17 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er rorCode] 17 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er rorCode]
18 * . 18 * .
19 */ 19 */
20 class ErrorSeverity extends Enum<ErrorSeverity> { 20 class ErrorSeverity extends Enum<ErrorSeverity> {
21 /** 21 /**
22 * The severity representing a non-error. This is never used for any error cod e, but is useful for 22 * The severity representing a non-error. This is never used for any error cod e, but is useful for
23 * clients. 23 * clients.
24 */ 24 */
25 static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none"); 25 static const ErrorSeverity NONE = const ErrorSeverity('NONE', 0, " ", "none");
26 26
27 /** 27 /**
28 * The severity representing an informational level analysis issue. 28 * The severity representing an informational level analysis issue.
29 */ 29 */
30 static final ErrorSeverity INFO = new ErrorSeverity('INFO', 1, "I", "info"); 30 static const ErrorSeverity INFO = const ErrorSeverity('INFO', 1, "I", "info");
31 31
32 /** 32 /**
33 * The severity representing a warning. Warnings can become errors if the `-We rror` command 33 * The severity representing a warning. Warnings can become errors if the `-We rror` command
34 * line flag is specified. 34 * line flag is specified.
35 */ 35 */
36 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "war ning"); 36 static const ErrorSeverity WARNING = const ErrorSeverity('WARNING', 2, "W", "w arning");
37 37
38 /** 38 /**
39 * The severity representing an error. 39 * The severity representing an error.
40 */ 40 */
41 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 3, "E", "error") ; 41 static const ErrorSeverity ERROR = const ErrorSeverity('ERROR', 3, "E", "error ");
42 42
43 static final List<ErrorSeverity> values = [NONE, INFO, WARNING, ERROR]; 43 static const List<ErrorSeverity> values = const [NONE, INFO, WARNING, ERROR];
44 44
45 /** 45 /**
46 * The name of the severity used when producing machine output. 46 * The name of the severity used when producing machine output.
47 */ 47 */
48 String machineCode; 48 final String machineCode;
49 49
50 /** 50 /**
51 * The name of the severity used when producing readable output. 51 * The name of the severity used when producing readable output.
52 */ 52 */
53 String displayName; 53 final String displayName;
54 54
55 /** 55 /**
56 * Initialize a newly created severity with the given names. 56 * Initialize a newly created severity with the given names.
57 * 57 *
58 * @param machineCode the name of the severity used when producing machine out put 58 * @param machineCode the name of the severity used when producing machine out put
59 * @param displayName the name of the severity used when producing readable ou tput 59 * @param displayName the name of the severity used when producing readable ou tput
60 */ 60 */
61 ErrorSeverity(String name, int ordinal, String machineCode, String displayName ) : super(name, ordinal) { 61 const ErrorSeverity(String name, int ordinal, this.machineCode, this.displayNa me) : super(name, ordinal);
62 this.machineCode = machineCode;
63 this.displayName = displayName;
64 }
65 62
66 /** 63 /**
67 * Return the severity constant that represents the greatest severity. 64 * Return the severity constant that represents the greatest severity.
68 * 65 *
69 * @param severity the severity being compared against 66 * @param severity the severity being compared against
70 * @return the most sever of this or the given severity 67 * @return the most sever of this or the given severity
71 */ 68 */
72 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal ? this : severity; 69 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal ? this : severity;
73 } 70 }
74 71
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 @override 134 @override
138 void onError(AnalysisError error) { 135 void onError(AnalysisError error) {
139 _errorReported = true; 136 _errorReported = true;
140 } 137 }
141 } 138 }
142 139
143 /** 140 /**
144 * The enumeration `AngularCode` defines Angular specific problems. 141 * The enumeration `AngularCode` defines Angular specific problems.
145 */ 142 */
146 class AngularCode extends Enum<AngularCode> implements ErrorCode { 143 class AngularCode extends Enum<AngularCode> implements ErrorCode {
147 static final AngularCode CANNOT_PARSE_SELECTOR = new AngularCode.con1('CANNOT_ PARSE_SELECTOR', 0, "The selector '%s' cannot be parsed"); 144 static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode('CANNOT_PAR SE_SELECTOR', 0, "The selector '%s' cannot be parsed");
148 145
149 static final AngularCode INVALID_PROPERTY_KIND = new AngularCode.con2('INVALID _PROPERTY_KIND', 1, "Unknown property binding kind '%s', use one of the '@', '=> ', '=>!' or '<=>'", ErrorSeverity.ERROR); 146 static const AngularCode INVALID_PROPERTY_KIND = const AngularCode('INVALID_PR OPERTY_KIND', 1, "Unknown property binding kind '%s', use one of the '@', '=>', '=>!' or '<=>'");
150 147
151 static final AngularCode INVALID_PROPERTY_FIELD = new AngularCode.con1('INVALI D_PROPERTY_FIELD', 2, "Unknown property field '%s'"); 148 static const AngularCode INVALID_PROPERTY_FIELD = const AngularCode('INVALID_P ROPERTY_FIELD', 2, "Unknown property field '%s'");
152 149
153 static final AngularCode INVALID_PROPERTY_MAP = new AngularCode.con1('INVALID_ PROPERTY_MAP', 3, "Argument 'map' must be a constant map literal"); 150 static const AngularCode INVALID_PROPERTY_MAP = const AngularCode('INVALID_PRO PERTY_MAP', 3, "Argument 'map' must be a constant map literal");
154 151
155 static final AngularCode INVALID_PROPERTY_NAME = new AngularCode.con1('INVALID _PROPERTY_NAME', 4, "Property name must be a string literal"); 152 static const AngularCode INVALID_PROPERTY_NAME = const AngularCode('INVALID_PR OPERTY_NAME', 4, "Property name must be a string literal");
156 153
157 static final AngularCode INVALID_PROPERTY_SPEC = new AngularCode.con1('INVALID _PROPERTY_SPEC', 5, "Property binding specification must be a string literal"); 154 static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode('INVALID_PR OPERTY_SPEC', 5, "Property binding specification must be a string literal");
158 155
159 static final AngularCode INVALID_REPEAT_SYNTAX = new AngularCode.con1('INVALID _REPEAT_SYNTAX', 6, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'"); 156 static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode('INVALID_RE PEAT_SYNTAX', 6, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
160 157
161 static final AngularCode INVALID_REPEAT_ITEM_SYNTAX = new AngularCode.con1('IN VALID_REPEAT_ITEM_SYNTAX', 7, "Item must by identifier or in '(_key_, _value_)' pair."); 158 static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode('INVAL ID_REPEAT_ITEM_SYNTAX', 7, "Item must by identifier or in '(_key_, _value_)' pai r.");
162 159
163 static final AngularCode INVALID_URI = new AngularCode.con2('INVALID_URI', 8, "Invalid URI syntax: '%s'", ErrorSeverity.ERROR); 160 static const AngularCode INVALID_URI = const AngularCode('INVALID_URI', 8, "In valid URI syntax: '%s'");
164 161
165 static final AngularCode MISSING_FILTER_COLON = new AngularCode.con1('MISSING_ FILTER_COLON', 9, "Missing ':' before filter argument"); 162 static const AngularCode MISSING_FILTER_COLON = const AngularCode('MISSING_FIL TER_COLON', 9, "Missing ':' before filter argument");
166 163
167 static final AngularCode MISSING_NAME = new AngularCode.con1('MISSING_NAME', 1 0, "Argument 'name' must be provided"); 164 static const AngularCode MISSING_NAME = const AngularCode('MISSING_NAME', 10, "Argument 'name' must be provided");
168 165
169 static final AngularCode MISSING_PUBLISH_AS = new AngularCode.con1('MISSING_PU BLISH_AS', 11, "Argument 'publishAs' must be provided"); 166 static const AngularCode MISSING_PUBLISH_AS = const AngularCode('MISSING_PUBLI SH_AS', 11, "Argument 'publishAs' must be provided");
170 167
171 static final AngularCode MISSING_SELECTOR = new AngularCode.con1('MISSING_SELE CTOR', 12, "Argument 'selector' must be provided"); 168 static const AngularCode MISSING_SELECTOR = const AngularCode('MISSING_SELECTO R', 12, "Argument 'selector' must be provided");
172 169
173 static final AngularCode URI_DOES_NOT_EXIST = new AngularCode.con1('URI_DOES_N OT_EXIST', 13, "Target of URI does not exist: '%s'"); 170 static const AngularCode URI_DOES_NOT_EXIST = const AngularCode('URI_DOES_NOT_ EXIST', 13, "Target of URI does not exist: '%s'");
174 171
175 static final List<AngularCode> values = [ 172 static const List<AngularCode> values = const [
176 CANNOT_PARSE_SELECTOR, 173 CANNOT_PARSE_SELECTOR,
177 INVALID_PROPERTY_KIND, 174 INVALID_PROPERTY_KIND,
178 INVALID_PROPERTY_FIELD, 175 INVALID_PROPERTY_FIELD,
179 INVALID_PROPERTY_MAP, 176 INVALID_PROPERTY_MAP,
180 INVALID_PROPERTY_NAME, 177 INVALID_PROPERTY_NAME,
181 INVALID_PROPERTY_SPEC, 178 INVALID_PROPERTY_SPEC,
182 INVALID_REPEAT_SYNTAX, 179 INVALID_REPEAT_SYNTAX,
183 INVALID_REPEAT_ITEM_SYNTAX, 180 INVALID_REPEAT_ITEM_SYNTAX,
184 INVALID_URI, 181 INVALID_URI,
185 MISSING_FILTER_COLON, 182 MISSING_FILTER_COLON,
186 MISSING_NAME, 183 MISSING_NAME,
187 MISSING_PUBLISH_AS, 184 MISSING_PUBLISH_AS,
188 MISSING_SELECTOR, 185 MISSING_SELECTOR,
189 URI_DOES_NOT_EXIST]; 186 URI_DOES_NOT_EXIST];
190 187
191 /** 188 /**
192 * The template used to create the message to be displayed for this error. 189 * The template used to create the message to be displayed for this error.
193 */ 190 */
194 String _message; 191 final String message;
195
196 /**
197 * The severity of the problem.
198 */
199 ErrorSeverity _severity;
200 192
201 /** 193 /**
202 * Initialize a newly created error code to have the given message. 194 * Initialize a newly created error code to have the given message.
203 * 195 *
204 * @param message the message template used to create the message to be displa yed for the error 196 * @param message the message template used to create the message to be displa yed for the error
205 */ 197 */
206 AngularCode.con1(String name, int ordinal, String message) : this.con2(name, o rdinal, message, ErrorSeverity.WARNING); 198 const AngularCode(String name, int ordinal, this.message) : super(name, ordina l);
207
208 /**
209 * Initialize a newly created error code to have the given message.
210 *
211 * @param message the message template used to create the message to be displa yed for the error
212 * @param severity the severity of the problem
213 */
214 AngularCode.con2(String name, int ordinal, String message, ErrorSeverity sever ity) : super(name, ordinal) {
215 this._message = message;
216 this._severity = ErrorSeverity.INFO;
217 }
218 199
219 @override 200 @override
220 String get correction => null; 201 String get correction => null;
221 202
222 @override 203 @override
223 ErrorSeverity get errorSeverity => _severity; 204 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
224
225 @override
226 String get message => _message;
227 205
228 @override 206 @override
229 ErrorType get type => ErrorType.ANGULAR; 207 ErrorType get type => ErrorType.ANGULAR;
230 } 208 }
231 209
232 /** 210 /**
233 * Instances of the class `ErrorReporter` wrap an error listener with utility me thods used to 211 * Instances of the class `ErrorReporter` wrap an error listener with utility me thods used to
234 * create the errors being reported. 212 * create the errors being reported.
235 */ 213 */
236 class ErrorReporter { 214 class ErrorReporter {
237 /** 215 /**
238 * The error listener to which errors will be reported. 216 * The error listener to which errors will be reported.
239 */ 217 */
240 AnalysisErrorListener _errorListener; 218 final AnalysisErrorListener _errorListener;
241 219
242 /** 220 /**
243 * The default source to be used when reporting errors. 221 * The default source to be used when reporting errors.
244 */ 222 */
245 Source _defaultSource; 223 final Source _defaultSource;
246 224
247 /** 225 /**
248 * The source to be used when reporting errors. 226 * The source to be used when reporting errors.
249 */ 227 */
250 Source _source; 228 Source _source;
251 229
252 /** 230 /**
253 * Initialize a newly created error reporter that will report errors to the gi ven listener. 231 * Initialize a newly created error reporter that will report errors to the gi ven listener.
254 * 232 *
255 * @param errorListener the error listener to which errors will be reported 233 * @param errorListener the error listener to which errors will be reported
256 * @param defaultSource the default source to be used when reporting errors 234 * @param defaultSource the default source to be used when reporting errors
257 */ 235 */
258 ErrorReporter(AnalysisErrorListener errorListener, Source defaultSource) { 236 ErrorReporter(this._errorListener, this._defaultSource) {
259 if (errorListener == null) { 237 if (_errorListener == null) {
260 throw new IllegalArgumentException("An error listener must be provided"); 238 throw new IllegalArgumentException("An error listener must be provided");
261 } else if (defaultSource == null) { 239 } else if (_defaultSource == null) {
262 throw new IllegalArgumentException("A default source must be provided"); 240 throw new IllegalArgumentException("A default source must be provided");
263 } 241 }
264 this._errorListener = errorListener; 242 this._source = _defaultSource;
265 this._defaultSource = defaultSource;
266 this._source = defaultSource;
267 } 243 }
268 244
269 /** 245 /**
270 * Creates an error with properties with the given error code and arguments. 246 * Creates an error with properties with the given error code and arguments.
271 * 247 *
272 * @param errorCode the error code of the error to be reported 248 * @param errorCode the error code of the error to be reported
273 * @param node the node specifying the location of the error 249 * @param node the node specifying the location of the error
274 * @param arguments the arguments to the error, used to compose the error mess age 250 * @param arguments the arguments to the error, used to compose the error mess age
275 */ 251 */
276 AnalysisErrorWithProperties newErrorWithProperties(ErrorCode errorCode, AstNod e node, List<Object> arguments) => new AnalysisErrorWithProperties.con2(_source, node.offset, node.length, errorCode, arguments); 252 AnalysisErrorWithProperties newErrorWithProperties(ErrorCode errorCode, AstNod e node, List<Object> arguments) => new AnalysisErrorWithProperties.con2(_source, node.offset, node.length, errorCode, arguments);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (errorSeverity1 == errorSeverity2) { 348 if (errorSeverity1 == errorSeverity2) {
373 return errorType1.compareTo(errorType2); 349 return errorType1.compareTo(errorType2);
374 } else { 350 } else {
375 return errorSeverity2.compareTo(errorSeverity1); 351 return errorSeverity2.compareTo(errorSeverity1);
376 } 352 }
377 }; 353 };
378 354
379 /** 355 /**
380 * The error code associated with the error. 356 * The error code associated with the error.
381 */ 357 */
382 ErrorCode errorCode; 358 final ErrorCode errorCode;
383 359
384 /** 360 /**
385 * The localized error message. 361 * The localized error message.
386 */ 362 */
387 String _message; 363 String _message;
388 364
389 /** 365 /**
390 * The correction to be displayed for this error, or `null` if there is no cor rection 366 * The correction to be displayed for this error, or `null` if there is no cor rection
391 * information for this error. 367 * information for this error.
392 */ 368 */
(...skipping 22 matching lines...) Expand all
415 bool isStaticOnly = false; 391 bool isStaticOnly = false;
416 392
417 /** 393 /**
418 * Initialize a newly created analysis error for the specified source. The err or has no location 394 * Initialize a newly created analysis error for the specified source. The err or has no location
419 * information. 395 * information.
420 * 396 *
421 * @param source the source for which the exception occurred 397 * @param source the source for which the exception occurred
422 * @param errorCode the error code to be associated with this error 398 * @param errorCode the error code to be associated with this error
423 * @param arguments the arguments used to build the error message 399 * @param arguments the arguments used to build the error message
424 */ 400 */
425 AnalysisError.con1(Source source, ErrorCode errorCode, List<Object> arguments) { 401 AnalysisError.con1(this.source, this.errorCode, List<Object> arguments) {
426 this.source = source;
427 this.errorCode = errorCode;
428 this._message = JavaString.format(errorCode.message, arguments); 402 this._message = JavaString.format(errorCode.message, arguments);
429 } 403 }
430 404
431 /** 405 /**
432 * Initialize a newly created analysis error for the specified source at the g iven location. 406 * Initialize a newly created analysis error for the specified source at the g iven location.
433 * 407 *
434 * @param source the source for which the exception occurred 408 * @param source the source for which the exception occurred
435 * @param offset the offset of the location of the error 409 * @param offset the offset of the location of the error
436 * @param length the length of the location of the error 410 * @param length the length of the location of the error
437 * @param errorCode the error code to be associated with this error 411 * @param errorCode the error code to be associated with this error
438 * @param arguments the arguments used to build the error message 412 * @param arguments the arguments used to build the error message
439 */ 413 */
440 AnalysisError.con2(Source source, int offset, int length, ErrorCode errorCode, List<Object> arguments) { 414 AnalysisError.con2(this.source, int offset, int length, this.errorCode, List<O bject> arguments) {
441 this.source = source;
442 this._offset = offset; 415 this._offset = offset;
443 this._length = length; 416 this._length = length;
444 this.errorCode = errorCode;
445 this._message = JavaString.format(errorCode.message, arguments); 417 this._message = JavaString.format(errorCode.message, arguments);
446 String correctionTemplate = errorCode.correction; 418 String correctionTemplate = errorCode.correction;
447 if (correctionTemplate != null) { 419 if (correctionTemplate != null) {
448 this._correction = JavaString.format(correctionTemplate, arguments); 420 this._correction = JavaString.format(correctionTemplate, arguments);
449 } 421 }
450 } 422 }
451 423
452 @override 424 @override
453 bool operator ==(Object obj) { 425 bool operator ==(Object obj) {
454 if (identical(obj, this)) { 426 if (identical(obj, this)) {
455 return true; 427 return true;
456 } 428 }
457 // prepare other AnalysisError 429 // prepare other AnalysisError
458 if (obj is! AnalysisError) { 430 if (obj is! AnalysisError) {
459 return false; 431 return false;
460 } 432 }
461 AnalysisError other = obj as AnalysisError; 433 AnalysisError other = obj as AnalysisError;
462 // Quick checks. 434 // Quick checks.
463 if (errorCode != other.errorCode) { 435 if (!identical(errorCode, other.errorCode)) {
464 return false; 436 return false;
465 } 437 }
466 if (_offset != other._offset || _length != other._length) { 438 if (_offset != other._offset || _length != other._length) {
467 return false; 439 return false;
468 } 440 }
469 if (isStaticOnly != other.isStaticOnly) { 441 if (isStaticOnly != other.isStaticOnly) {
470 return false; 442 return false;
471 } 443 }
472 // Deep checks. 444 // Deep checks.
473 if (_message != other._message) { 445 if (_message != other._message) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 518
547 /** 519 /**
548 * The enumeration `ErrorProperty` defines the properties that can be associated with an 520 * The enumeration `ErrorProperty` defines the properties that can be associated with an
549 * [AnalysisError]. 521 * [AnalysisError].
550 */ 522 */
551 class ErrorProperty extends Enum<ErrorProperty> { 523 class ErrorProperty extends Enum<ErrorProperty> {
552 /** 524 /**
553 * A property whose value is an array of [ExecutableElement] that should 525 * A property whose value is an array of [ExecutableElement] that should
554 * be but are not implemented by a concrete class. 526 * be but are not implemented by a concrete class.
555 */ 527 */
556 static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEM ENTED_METHODS', 0); 528 static const ErrorProperty UNIMPLEMENTED_METHODS = const ErrorProperty('UNIMPL EMENTED_METHODS', 0);
557 529
558 static final List<ErrorProperty> values = [UNIMPLEMENTED_METHODS]; 530 static const List<ErrorProperty> values = const [UNIMPLEMENTED_METHODS];
559 531
560 ErrorProperty(String name, int ordinal) : super(name, ordinal); 532 const ErrorProperty(String name, int ordinal) : super(name, ordinal);
561 } 533 }
562 534
563 /** 535 /**
564 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. 536 * The enumeration `TodoCode` defines the single TODO `ErrorCode`.
565 */ 537 */
566 class TodoCode extends Enum<TodoCode> implements ErrorCode { 538 class TodoCode extends Enum<TodoCode> implements ErrorCode {
567 /** 539 /**
568 * The single enum of TodoCode. 540 * The single enum of TodoCode.
569 */ 541 */
570 static final TodoCode TODO = new TodoCode('TODO', 0); 542 static const TodoCode TODO = const TodoCode('TODO', 0);
571 543
572 static final List<TodoCode> values = [TODO]; 544 static const List<TodoCode> values = const [TODO];
573 545
574 /** 546 /**
575 * This matches the two common Dart task styles 547 * This matches the two common Dart task styles
576 * 548 *
577 * * TODO: 549 * * TODO:
578 * * TODO(username): 550 * * TODO(username):
579 * 551 *
580 * As well as 552 * As well as
581 * * TODO 553 * * TODO
582 * 554 *
583 * But not 555 * But not
584 * * todo 556 * * todo
585 * * TODOS 557 * * TODOS
586 */ 558 */
587 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|( TODO:?\$))"); 559 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|( TODO:?\$))");
588 560
589 TodoCode(String name, int ordinal) : super(name, ordinal); 561 const TodoCode(String name, int ordinal) : super(name, ordinal);
590 562
591 @override 563 @override
592 String get correction => null; 564 String get correction => null;
593 565
594 @override 566 @override
595 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 567 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
596 568
597 @override 569 @override
598 String get message => "%s"; 570 String get message => "%s";
599 571
600 @override 572 @override
601 ErrorType get type => ErrorType.TODO; 573 ErrorType get type => ErrorType.TODO;
602 } 574 }
603 575
604 /** 576 /**
605 * The enumeration `HintCode` defines the hints and coding recommendations for b est practices 577 * The enumeration `HintCode` defines the hints and coding recommendations for b est practices
606 * which are not mentioned in the Dart Language Specification. 578 * which are not mentioned in the Dart Language Specification.
607 */ 579 */
608 class HintCode extends Enum<HintCode> implements ErrorCode { 580 class HintCode extends Enum<HintCode> implements ErrorCode {
609 /** 581 /**
610 * This hint is generated anywhere where the 582 * This hint is generated anywhere where the
611 * [StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, if we used 583 * [StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, if we used
612 * propagated information for the warnings. 584 * propagated information for the warnings.
613 * 585 *
614 * @param actualType the name of the actual argument type 586 * @param actualType the name of the actual argument type
615 * @param expectedType the name of the expected type 587 * @param expectedType the name of the expected type
616 * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE 588 * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
617 */ 589 */
618 static final HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new HintCode.con1('ARGUME NT_TYPE_NOT_ASSIGNABLE', 0, StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE.messa ge); 590 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode.con1('ARGU MENT_TYPE_NOT_ASSIGNABLE', 0, "The argument type '%s' cannot be assigned to the parameter type '%s'");
619 591
620 /** 592 /**
621 * Dead code is code that is never reached, this can happen for instance if a statement follows a 593 * Dead code is code that is never reached, this can happen for instance if a statement follows a
622 * return statement. 594 * return statement.
623 */ 595 */
624 static final HintCode DEAD_CODE = new HintCode.con1('DEAD_CODE', 1, "Dead code "); 596 static const HintCode DEAD_CODE = const HintCode.con1('DEAD_CODE', 1, "Dead co de");
625 597
626 /** 598 /**
627 * Dead code is code that is never reached. This case covers cases where the u ser has catch 599 * Dead code is code that is never reached. This case covers cases where the u ser has catch
628 * clauses after `catch (e)` or `on Object catch (e)`. 600 * clauses after `catch (e)` or `on Object catch (e)`.
629 */ 601 */
630 static final HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = new HintCode.con1('DEA D_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached"); 602 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode.con1('D EAD_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e) ' or an 'on Object catch (e)' are never reached");
631 603
632 /** 604 /**
633 * Dead code is code that is never reached. This case covers cases where the u ser has an on-catch 605 * Dead code is code that is never reached. This case covers cases where the u ser has an on-catch
634 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh t. 606 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh t.
635 * 607 *
636 * @param subtypeName name of the subtype 608 * @param subtypeName name of the subtype
637 * @param supertypeName name of the supertype 609 * @param supertypeName name of the supertype
638 */ 610 */
639 static final HintCode DEAD_CODE_ON_CATCH_SUBTYPE = new HintCode.con1('DEAD_COD E_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed s ince '%s' is a subtype of '%s'"); 611 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode.con1('DEAD_C ODE_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed since '%s' is a subtype of '%s'");
640 612
641 /** 613 /**
642 * Deprecated members should not be invoked or used. 614 * Deprecated members should not be invoked or used.
643 * 615 *
644 * @param memberName the name of the member 616 * @param memberName the name of the member
645 */ 617 */
646 static final HintCode DEPRECATED_MEMBER_USE = new HintCode.con1('DEPRECATED_ME MBER_USE', 4, "'%s' is deprecated"); 618 static const HintCode DEPRECATED_MEMBER_USE = const HintCode.con1('DEPRECATED_ MEMBER_USE', 4, "'%s' is deprecated");
647 619
648 /** 620 /**
649 * Duplicate imports. 621 * Duplicate imports.
650 */ 622 */
651 static final HintCode DUPLICATE_IMPORT = new HintCode.con1('DUPLICATE_IMPORT', 5, "Duplicate import"); 623 static const HintCode DUPLICATE_IMPORT = const HintCode.con1('DUPLICATE_IMPORT ', 5, "Duplicate import");
652 624
653 /** 625 /**
654 * Hint to use the ~/ operator. 626 * Hint to use the ~/ operator.
655 */ 627 */
656 static final HintCode DIVISION_OPTIMIZATION = new HintCode.con1('DIVISION_OPTI MIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()"); 628 static const HintCode DIVISION_OPTIMIZATION = const HintCode.con1('DIVISION_OP TIMIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()");
657 629
658 /** 630 /**
659 * Hint for the `x is double` type checks. 631 * Hint for the `x is double` type checks.
660 */ 632 */
661 static final HintCode IS_DOUBLE = new HintCode.con1('IS_DOUBLE', 7, "When comp iled to JS, this test might return true when the left hand side is an int"); 633 static const HintCode IS_DOUBLE = const HintCode.con1('IS_DOUBLE', 7, "When co mpiled to JS, this test might return true when the left hand side is an int");
662 634
663 /** 635 /**
664 * Hint for the `x is int` type checks. 636 * Hint for the `x is int` type checks.
665 */ 637 */
666 static final HintCode IS_INT = new HintCode.con1('IS_INT', 8, "When compiled t o JS, this test might return true when the left hand side is a double"); 638 static const HintCode IS_INT = const HintCode.con1('IS_INT', 8, "When compiled to JS, this test might return true when the left hand side is a double");
667 639
668 /** 640 /**
669 * Hint for the `x is! double` type checks. 641 * Hint for the `x is! double` type checks.
670 */ 642 */
671 static final HintCode IS_NOT_DOUBLE = new HintCode.con1('IS_NOT_DOUBLE', 9, "W hen compiled to JS, this test might return false when the left hand side is an i nt"); 643 static const HintCode IS_NOT_DOUBLE = const HintCode.con1('IS_NOT_DOUBLE', 9, "When compiled to JS, this test might return false when the left hand side is an int");
672 644
673 /** 645 /**
674 * Hint for the `x is! int` type checks. 646 * Hint for the `x is! int` type checks.
675 */ 647 */
676 static final HintCode IS_NOT_INT = new HintCode.con1('IS_NOT_INT', 10, "When c ompiled to JS, this test might return false when the left hand side is a double" ); 648 static const HintCode IS_NOT_INT = const HintCode.con1('IS_NOT_INT', 10, "When compiled to JS, this test might return false when the left hand side is a doubl e");
677 649
678 /** 650 /**
679 * Generate a hint for methods or functions that have a return type, but do no t have a non-void 651 * Generate a hint for methods or functions that have a return type, but do no t have a non-void
680 * return statement on all branches. At the end of methods or functions with n o return, Dart 652 * return statement on all branches. At the end of methods or functions with n o return, Dart
681 * implicitly returns `null`, avoiding these implicit returns is considered a best practice. 653 * implicitly returns `null`, avoiding these implicit returns is considered a best practice.
682 * 654 *
683 * @param returnType the name of the declared return type 655 * @param returnType the name of the declared return type
684 */ 656 */
685 static final HintCode MISSING_RETURN = new HintCode.con2('MISSING_RETURN', 11, "This function declares a return type of '%s', but does not end with a return s tatement", "Either add a return statement or change the return type to 'void'"); 657 static const HintCode MISSING_RETURN = const HintCode.con2('MISSING_RETURN', 1 1, "This function declares a return type of '%s', but does not end with a return statement", "Either add a return statement or change the return type to 'void'" );
686 658
687 /** 659 /**
688 * A getter with the override annotation does not override an existing getter. 660 * A getter with the override annotation does not override an existing getter.
689 */ 661 */
690 static final HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = new HintCode.con1('O VERRIDE_ON_NON_OVERRIDING_GETTER', 12, "Getter does not override an inherited ge tter"); 662 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_GETTER', 12, "Getter does not override an inherited getter");
691 663
692 /** 664 /**
693 * A method with the override annotation does not override an existing method. 665 * A method with the override annotation does not override an existing method.
694 */ 666 */
695 static final HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = new HintCode.con1('O VERRIDE_ON_NON_OVERRIDING_METHOD', 13, "Method does not override an inherited me thod"); 667 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_METHOD', 13, "Method does not override an inherited method");
696 668
697 /** 669 /**
698 * A setter with the override annotation does not override an existing setter. 670 * A setter with the override annotation does not override an existing setter.
699 */ 671 */
700 static final HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = new HintCode.con1('O VERRIDE_ON_NON_OVERRIDING_SETTER', 14, "Setter does not override an inherited se tter"); 672 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_SETTER', 14, "Setter does not override an inherited setter");
701 673
702 /** 674 /**
703 * It is not in best practice to declare a private method that happens to over ride the method in a 675 * It is not in best practice to declare a private method that happens to over ride the method in a
704 * superclass- depending on where the superclass is (either in the same librar y, or out of the 676 * superclass- depending on where the superclass is (either in the same librar y, or out of the
705 * same library), behavior can be different. 677 * same library), behavior can be different.
706 * 678 *
707 * @param memberType this is either "method", "getter" or "setter" 679 * @param memberType this is either "method", "getter" or "setter"
708 * @param memberName some private member name 680 * @param memberName some private member name
709 * @param className the class name where the member is overriding the function ality 681 * @param className the class name where the member is overriding the function ality
710 */ 682 */
711 static final HintCode OVERRIDDING_PRIVATE_MEMBER = new HintCode.con1('OVERRIDD ING_PRIVATE_MEMBER', 15, "The %s '%s' does not override the definition from '%s' because it is private and in a different library"); 683 static const HintCode OVERRIDDING_PRIVATE_MEMBER = const HintCode.con1('OVERRI DDING_PRIVATE_MEMBER', 15, "The %s '%s' does not override the definition from '% s' because it is private and in a different library");
712 684
713 /** 685 /**
714 * Hint for classes that override equals, but not hashCode. 686 * Hint for classes that override equals, but not hashCode.
715 * 687 *
716 * @param className the name of the current class 688 * @param className the name of the current class
717 */ 689 */
718 static final HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = new HintCode.con1('O VERRIDE_EQUALS_BUT_NOT_HASH_CODE', 16, "The class '%s' overrides 'operator==', b ut not 'get hashCode'"); 690 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode.con1( 'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 16, "The class '%s' overrides 'operator==', but not 'get hashCode'");
719 691
720 /** 692 /**
721 * Type checks of the type `x is! Null` should be done with `x != null`. 693 * Type checks of the type `x is! Null` should be done with `x != null`.
722 */ 694 */
723 static final HintCode TYPE_CHECK_IS_NOT_NULL = new HintCode.con1('TYPE_CHECK_I S_NOT_NULL', 17, "Tests for non-null should be done with '!= null'"); 695 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode.con1('TYPE_CHECK _IS_NOT_NULL', 17, "Tests for non-null should be done with '!= null'");
724 696
725 /** 697 /**
726 * Type checks of the type `x is Null` should be done with `x == null`. 698 * Type checks of the type `x is Null` should be done with `x == null`.
727 */ 699 */
728 static final HintCode TYPE_CHECK_IS_NULL = new HintCode.con1('TYPE_CHECK_IS_NU LL', 18, "Tests for null should be done with '== null'"); 700 static const HintCode TYPE_CHECK_IS_NULL = const HintCode.con1('TYPE_CHECK_IS_ NULL', 18, "Tests for null should be done with '== null'");
729 701
730 /** 702 /**
731 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ GETTER] or 703 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ GETTER] or
732 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used propagated 704 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used propagated
733 * information for the warnings. 705 * information for the warnings.
734 * 706 *
735 * @param getterName the name of the getter 707 * @param getterName the name of the getter
736 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for 708 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for
737 * @see StaticTypeWarningCode#UNDEFINED_GETTER 709 * @see StaticTypeWarningCode#UNDEFINED_GETTER
738 * @see StaticWarningCode#UNDEFINED_GETTER 710 * @see StaticWarningCode#UNDEFINED_GETTER
739 */ 711 */
740 static final HintCode UNDEFINED_GETTER = new HintCode.con1('UNDEFINED_GETTER', 19, StaticTypeWarningCode.UNDEFINED_GETTER.message); 712 static const HintCode UNDEFINED_GETTER = const HintCode.con1('UNDEFINED_GETTER ', 19, "There is no such getter '%s' in '%s'");
741 713
742 /** 714 /**
743 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ METHOD] would 715 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ METHOD] would
744 * have been generated, if we used propagated information for the warnings. 716 * have been generated, if we used propagated information for the warnings.
745 * 717 *
746 * @param methodName the name of the method that is undefined 718 * @param methodName the name of the method that is undefined
747 * @param typeName the resolved type name that the method lookup is happening on 719 * @param typeName the resolved type name that the method lookup is happening on
748 * @see StaticTypeWarningCode#UNDEFINED_METHOD 720 * @see StaticTypeWarningCode#UNDEFINED_METHOD
749 */ 721 */
750 static final HintCode UNDEFINED_METHOD = new HintCode.con1('UNDEFINED_METHOD', 20, StaticTypeWarningCode.UNDEFINED_METHOD.message); 722 static const HintCode UNDEFINED_METHOD = const HintCode.con1('UNDEFINED_METHOD ', 20, "The method '%s' is not defined for the class '%s'");
751 723
752 /** 724 /**
753 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ OPERATOR] 725 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ OPERATOR]
754 * would have been generated, if we used propagated information for the warnin gs. 726 * would have been generated, if we used propagated information for the warnin gs.
755 * 727 *
756 * @param operator the name of the operator 728 * @param operator the name of the operator
757 * @param enclosingType the name of the enclosing type where the operator is b eing looked for 729 * @param enclosingType the name of the enclosing type where the operator is b eing looked for
758 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR 730 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR
759 */ 731 */
760 static final HintCode UNDEFINED_OPERATOR = new HintCode.con1('UNDEFINED_OPERAT OR', 21, StaticTypeWarningCode.UNDEFINED_OPERATOR.message); 732 static const HintCode UNDEFINED_OPERATOR = const HintCode.con1('UNDEFINED_OPER ATOR', 21, "There is no such operator '%s' in '%s'");
761 733
762 /** 734 /**
763 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ SETTER] or 735 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ SETTER] or
764 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used propagated 736 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used propagated
765 * information for the warnings. 737 * information for the warnings.
766 * 738 *
767 * @param setterName the name of the setter 739 * @param setterName the name of the setter
768 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for 740 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for
769 * @see StaticTypeWarningCode#UNDEFINED_SETTER 741 * @see StaticTypeWarningCode#UNDEFINED_SETTER
770 * @see StaticWarningCode#UNDEFINED_SETTER 742 * @see StaticWarningCode#UNDEFINED_SETTER
771 */ 743 */
772 static final HintCode UNDEFINED_SETTER = new HintCode.con1('UNDEFINED_SETTER', 22, StaticTypeWarningCode.UNDEFINED_SETTER.message); 744 static const HintCode UNDEFINED_SETTER = const HintCode.con1('UNDEFINED_SETTER ', 22, "There is no such setter '%s' in '%s'");
773 745
774 /** 746 /**
775 * Unnecessary cast. 747 * Unnecessary cast.
776 */ 748 */
777 static final HintCode UNNECESSARY_CAST = new HintCode.con1('UNNECESSARY_CAST', 23, "Unnecessary cast"); 749 static const HintCode UNNECESSARY_CAST = const HintCode.con1('UNNECESSARY_CAST ', 23, "Unnecessary cast");
778 750
779 /** 751 /**
780 * Unnecessary type checks, the result is always true. 752 * Unnecessary type checks, the result is always true.
781 */ 753 */
782 static final HintCode UNNECESSARY_TYPE_CHECK_FALSE = new HintCode.con1('UNNECE SSARY_TYPE_CHECK_FALSE', 24, "Unnecessary type check, the result is always false "); 754 static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode.con1('UNNE CESSARY_TYPE_CHECK_FALSE', 24, "Unnecessary type check, the result is always fal se");
783 755
784 /** 756 /**
785 * Unnecessary type checks, the result is always false. 757 * Unnecessary type checks, the result is always false.
786 */ 758 */
787 static final HintCode UNNECESSARY_TYPE_CHECK_TRUE = new HintCode.con1('UNNECES SARY_TYPE_CHECK_TRUE', 25, "Unnecessary type check, the result is always true"); 759 static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode.con1('UNNEC ESSARY_TYPE_CHECK_TRUE', 25, "Unnecessary type check, the result is always true" );
788 760
789 /** 761 /**
790 * Unused imports are imports which are never not used. 762 * Unused imports are imports which are never not used.
791 */ 763 */
792 static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 26, " Unused import"); 764 static const HintCode UNUSED_IMPORT = const HintCode.con1('UNUSED_IMPORT', 26, "Unused import");
793 765
794 /** 766 /**
795 * Hint for cases where the source expects a method or function to return a no n-void result, but 767 * Hint for cases where the source expects a method or function to return a no n-void result, but
796 * the method or function signature returns void. 768 * the method or function signature returns void.
797 * 769 *
798 * @param name the name of the method or function that returns void 770 * @param name the name of the method or function that returns void
799 */ 771 */
800 static final HintCode USE_OF_VOID_RESULT = new HintCode.con1('USE_OF_VOID_RESU LT', 27, "The result of '%s' is being used, even though it is declared to be 'vo id'"); 772 static const HintCode USE_OF_VOID_RESULT = const HintCode.con1('USE_OF_VOID_RE SULT', 27, "The result of '%s' is being used, even though it is declared to be ' void'");
801 773
802 static final List<HintCode> values = [ 774 static const List<HintCode> values = const [
803 ARGUMENT_TYPE_NOT_ASSIGNABLE, 775 ARGUMENT_TYPE_NOT_ASSIGNABLE,
804 DEAD_CODE, 776 DEAD_CODE,
805 DEAD_CODE_CATCH_FOLLOWING_CATCH, 777 DEAD_CODE_CATCH_FOLLOWING_CATCH,
806 DEAD_CODE_ON_CATCH_SUBTYPE, 778 DEAD_CODE_ON_CATCH_SUBTYPE,
807 DEPRECATED_MEMBER_USE, 779 DEPRECATED_MEMBER_USE,
808 DUPLICATE_IMPORT, 780 DUPLICATE_IMPORT,
809 DIVISION_OPTIMIZATION, 781 DIVISION_OPTIMIZATION,
810 IS_DOUBLE, 782 IS_DOUBLE,
811 IS_INT, 783 IS_INT,
812 IS_NOT_DOUBLE, 784 IS_NOT_DOUBLE,
(...skipping 12 matching lines...) Expand all
825 UNDEFINED_SETTER, 797 UNDEFINED_SETTER,
826 UNNECESSARY_CAST, 798 UNNECESSARY_CAST,
827 UNNECESSARY_TYPE_CHECK_FALSE, 799 UNNECESSARY_TYPE_CHECK_FALSE,
828 UNNECESSARY_TYPE_CHECK_TRUE, 800 UNNECESSARY_TYPE_CHECK_TRUE,
829 UNUSED_IMPORT, 801 UNUSED_IMPORT,
830 USE_OF_VOID_RESULT]; 802 USE_OF_VOID_RESULT];
831 803
832 /** 804 /**
833 * The template used to create the message to be displayed for this error. 805 * The template used to create the message to be displayed for this error.
834 */ 806 */
835 String message; 807 final String message;
836 808
837 /** 809 /**
838 * The template used to create the correction to be displayed for this error, or `null` if 810 * The template used to create the correction to be displayed for this error, or `null` if
839 * there is no correction information for this error. 811 * there is no correction information for this error.
840 */ 812 */
841 String correction3; 813 final String correction;
842 814
843 /** 815 /**
844 * Initialize a newly created error code to have the given message. 816 * Initialize a newly created error code to have the given message.
845 * 817 *
846 * @param message the message template used to create the message to be displa yed for the error 818 * @param message the message template used to create the message to be displa yed for the error
847 */ 819 */
848 HintCode.con1(String name, int ordinal, String message) : super(name, ordinal) { 820 const HintCode.con1(String name, int ordinal, String message) : this.con2(name , ordinal, message, null);
849 this.message = message;
850 }
851 821
852 /** 822 /**
853 * Initialize a newly created error code to have the given message and correct ion. 823 * Initialize a newly created error code to have the given message and correct ion.
854 * 824 *
855 * @param message the template used to create the message to be displayed for the error 825 * @param message the template used to create the message to be displayed for the error
856 * @param correction the template used to create the correction to be displaye d for the error 826 * @param correction the template used to create the correction to be displaye d for the error
857 */ 827 */
858 HintCode.con2(String name, int ordinal, String message, String correction) : s uper(name, ordinal) { 828 const HintCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
859 this.message = message;
860 this.correction3 = correction;
861 }
862
863 @override
864 String get correction => correction3;
865 829
866 @override 830 @override
867 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; 831 ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
868 832
869 @override 833 @override
870 ErrorType get type => ErrorType.HINT; 834 ErrorType get type => ErrorType.HINT;
871 } 835 }
872 836
873 /** 837 /**
874 * The interface `ErrorCode` defines the behavior common to objects representing error codes 838 * The interface `ErrorCode` defines the behavior common to objects representing error codes
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 ErrorType get type; 875 ErrorType get type;
912 } 876 }
913 877
914 /** 878 /**
915 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode] . 879 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode] .
916 */ 880 */
917 class ErrorType extends Enum<ErrorType> { 881 class ErrorType extends Enum<ErrorType> {
918 /** 882 /**
919 * Task (todo) comments in user code. 883 * Task (todo) comments in user code.
920 */ 884 */
921 static final ErrorType TODO = new ErrorType('TODO', 0, ErrorSeverity.INFO); 885 static const ErrorType TODO = const ErrorType('TODO', 0, ErrorSeverity.INFO);
922 886
923 /** 887 /**
924 * Extra analysis run over the code to follow best practices, which are not in the Dart Language 888 * Extra analysis run over the code to follow best practices, which are not in the Dart Language
925 * Specification. 889 * Specification.
926 */ 890 */
927 static final ErrorType HINT = new ErrorType('HINT', 1, ErrorSeverity.INFO); 891 static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO);
928 892
929 /** 893 /**
930 * Compile-time errors are errors that preclude execution. A compile time erro r must be reported 894 * Compile-time errors are errors that preclude execution. A compile time erro r must be reported
931 * by a Dart compiler before the erroneous code is executed. 895 * by a Dart compiler before the erroneous code is executed.
932 */ 896 */
933 static final ErrorType COMPILE_TIME_ERROR = new ErrorType('COMPILE_TIME_ERROR' , 2, ErrorSeverity.ERROR); 897 static const ErrorType COMPILE_TIME_ERROR = const ErrorType('COMPILE_TIME_ERRO R', 2, ErrorSeverity.ERROR);
934 898
935 /** 899 /**
936 * Suggestions made in situations where the user has deviated from recommended pub programming 900 * Suggestions made in situations where the user has deviated from recommended pub programming
937 * practices. 901 * practices.
938 */ 902 */
939 static final ErrorType PUB_SUGGESTION = new ErrorType('PUB_SUGGESTION', 3, Err orSeverity.WARNING); 903 static const ErrorType PUB_SUGGESTION = const ErrorType('PUB_SUGGESTION', 3, E rrorSeverity.WARNING);
940 904
941 /** 905 /**
942 * Static warnings are those warnings reported by the static checker. They hav e no effect on 906 * Static warnings are those warnings reported by the static checker. They hav e no effect on
943 * execution. Static warnings must be provided by Dart compilers used during d evelopment. 907 * execution. Static warnings must be provided by Dart compilers used during d evelopment.
944 */ 908 */
945 static final ErrorType STATIC_WARNING = new ErrorType('STATIC_WARNING', 4, Err orSeverity.WARNING); 909 static const ErrorType STATIC_WARNING = const ErrorType('STATIC_WARNING', 4, E rrorSeverity.WARNING);
946 910
947 /** 911 /**
948 * Many, but not all, static warnings relate to types, in which case they are known as static type 912 * Many, but not all, static warnings relate to types, in which case they are known as static type
949 * warnings. 913 * warnings.
950 */ 914 */
951 static final ErrorType STATIC_TYPE_WARNING = new ErrorType('STATIC_TYPE_WARNIN G', 5, ErrorSeverity.WARNING); 915 static const ErrorType STATIC_TYPE_WARNING = const ErrorType('STATIC_TYPE_WARN ING', 5, ErrorSeverity.WARNING);
952 916
953 /** 917 /**
954 * Syntactic errors are errors produced as a result of input that does not con form to the grammar. 918 * Syntactic errors are errors produced as a result of input that does not con form to the grammar.
955 */ 919 */
956 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 6, E rrorSeverity.ERROR); 920 static const ErrorType SYNTACTIC_ERROR = const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
957 921
958 /** 922 /**
959 * Angular specific semantic problems. 923 * Angular specific semantic problems.
960 */ 924 */
961 static final ErrorType ANGULAR = new ErrorType('ANGULAR', 7, ErrorSeverity.INF O); 925 static const ErrorType ANGULAR = const ErrorType('ANGULAR', 7, ErrorSeverity.I NFO);
962 926
963 static final List<ErrorType> values = [ 927 static const List<ErrorType> values = const [
964 TODO, 928 TODO,
965 HINT, 929 HINT,
966 COMPILE_TIME_ERROR, 930 COMPILE_TIME_ERROR,
967 PUB_SUGGESTION, 931 PUB_SUGGESTION,
968 STATIC_WARNING, 932 STATIC_WARNING,
969 STATIC_TYPE_WARNING, 933 STATIC_TYPE_WARNING,
970 SYNTACTIC_ERROR, 934 SYNTACTIC_ERROR,
971 ANGULAR]; 935 ANGULAR];
972 936
973 /** 937 /**
974 * The severity of this type of error. 938 * The severity of this type of error.
975 */ 939 */
976 ErrorSeverity severity; 940 final ErrorSeverity severity;
977 941
978 /** 942 /**
979 * Initialize a newly created error type to have the given severity. 943 * Initialize a newly created error type to have the given severity.
980 * 944 *
981 * @param severity the severity of this type of error 945 * @param severity the severity of this type of error
982 */ 946 */
983 ErrorType(String name, int ordinal, ErrorSeverity severity) : super(name, ordi nal) { 947 const ErrorType(String name, int ordinal, this.severity) : super(name, ordinal );
984 this.severity = severity;
985 }
986 948
987 String get displayName => name.toLowerCase().replaceAll('_', ' '); 949 String get displayName => name.toLowerCase().replaceAll('_', ' ');
988 } 950 }
989 951
990 /** 952 /**
991 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time 953 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time
992 * errors. The convention for this class is for the name of the error code to in dicate the problem 954 * errors. The convention for this class is for the name of the error code to in dicate the problem
993 * that caused the error to be generated and for the error message to explain wh at is wrong and, 955 * that caused the error to be generated and for the error message to explain wh at is wrong and,
994 * when appropriate, how the problem can be corrected. 956 * when appropriate, how the problem can be corrected.
995 */ 957 */
996 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de { 958 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de {
997 /** 959 /**
998 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library 960 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library
999 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b y more than one 961 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b y more than one
1000 * export, unless each all exports refer to same declaration for the name N. 962 * export, unless each all exports refer to same declaration for the name N.
1001 * 963 *
1002 * @param ambiguousElementName the name of the ambiguous element 964 * @param ambiguousElementName the name of the ambiguous element
1003 * @param firstLibraryName the name of the first library that the type is foun d 965 * @param firstLibraryName the name of the first library that the type is foun d
1004 * @param secondLibraryName the name of the second library that the type is fo und 966 * @param secondLibraryName the name of the second library that the type is fo und
1005 */ 967 */
1006 static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode. con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' a nd '%s'"); 968 static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCod e.con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' and '%s'");
1007 969
1008 /** 970 /**
1009 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal 971 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal
1010 * parameter. 972 * parameter.
1011 * 973 *
1012 * @param the name of the identifier in the argument definition test that is n ot a parameter 974 * @param the name of the identifier in the argument definition test that is n ot a parameter
1013 */ 975 */
1014 static final CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = new CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 1, "'%s' is not a parameter"); 976 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = con st CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 1, "'%s' is not a parameter");
1015 977
1016 /** 978 /**
1017 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id entifier other than 979 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id entifier other than
1018 * dynamic as a type annotation. 980 * dynamic as a type annotation.
1019 */ 981 */
1020 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = new CompileTim eErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 2, "The built-in identifier '%s' cannot be as a type"); 982 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileT imeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 2, "The built-in identifier '%s ' cannot be as a type");
1021 983
1022 /** 984 /**
1023 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the 985 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the
1024 * declared name of a class, type parameter or type alias. 986 * declared name of a class, type parameter or type alias.
1025 */ 987 */
1026 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = new Compi leTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 3, "The built-in identi fier '%s' cannot be used as a type name"); 988 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const Com pileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 3, "The built-in iden tifier '%s' cannot be used as a type name");
1027 989
1028 /** 990 /**
1029 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the 991 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the
1030 * declared name of a class, type parameter or type alias. 992 * declared name of a class, type parameter or type alias.
1031 */ 993 */
1032 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = new Co mpileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 4, "The built-in identifier '%s' cannot be used as a type alias name"); 994 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 4, "The built-i n identifier '%s' cannot be used as a type alias name");
1033 995
1034 /** 996 /**
1035 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the 997 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the
1036 * declared name of a class, type parameter or type alias. 998 * declared name of a class, type parameter or type alias.
1037 */ 999 */
1038 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = new CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 5, "The built-in identifier '%s' cannot be used as a type parameter name"); 1000 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 5 , "The built-in identifier '%s' cannot be used as a type parameter name");
1039 1001
1040 /** 1002 /**
1041 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th e operator 1003 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th e operator
1042 * <i>==</i>. 1004 * <i>==</i>.
1043 */ 1005 */
1044 static final CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = new CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 6, "The swi tch case expression type '%s' cannot override the == operator"); 1006 static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = con st CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 6, "The s witch case expression type '%s' cannot override the == operator");
1045 1007
1046 /** 1008 /**
1047 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise 1009 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
1048 * an exception. 1010 * an exception.
1049 */ 1011 */
1050 static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = new CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 7, ""); 1012 static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = con st CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 7, "");
1051 1013
1052 /** 1014 /**
1053 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1015 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
1054 * name. This restriction holds regardless of whether the getter is defined ex plicitly or 1016 * name. This restriction holds regardless of whether the getter is defined ex plicitly or
1055 * implicitly, or whether the getter or the method are inherited or not. 1017 * implicitly, or whether the getter or the method are inherited or not.
1056 */ 1018 */
1057 static final CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = new CompileT imeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 8, "Class '%s' cannot have bo th getter '%s.%s' and method with the same name"); 1019 static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const Compil eTimeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 8, "Class '%s' cannot have both getter '%s.%s' and method with the same name");
1058 1020
1059 /** 1021 /**
1060 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1022 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
1061 * name. This restriction holds regardless of whether the getter is defined ex plicitly or 1023 * name. This restriction holds regardless of whether the getter is defined ex plicitly or
1062 * implicitly, or whether the getter or the method are inherited or not. 1024 * implicitly, or whether the getter or the method are inherited or not.
1063 */ 1025 */
1064 static final CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = new CompileT imeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 9, "Class '%s' cannot have bo th method '%s.%s' and getter with the same name"); 1026 static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const Compil eTimeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 9, "Class '%s' cannot have both method '%s.%s' and getter with the same name");
1065 1027
1066 /** 1028 /**
1067 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing 1029 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing
1068 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a 1030 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
1069 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing 1031 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing
1070 * class. 1032 * class.
1071 */ 1033 */
1072 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 10, "'%s' c annot be used to name a constructor and a field in this class"); 1034 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = con st CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 10, "'%s' cannot be used to name a constructor and a field in this class");
1073 1035
1074 /** 1036 /**
1075 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing 1037 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing
1076 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a 1038 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a
1077 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing 1039 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing
1078 * class. 1040 * class.
1079 */ 1041 */
1080 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = ne w CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 11, "'%s' cannot be used to name a constructor and a method in this class"); 1042 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = co nst CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 11, "'% s' cannot be used to name a constructor and a method in this class");
1081 1043
1082 /** 1044 /**
1083 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the 1045 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the
1084 * same name as the class or any of its members or constructors. 1046 * same name as the class or any of its members or constructors.
1085 */ 1047 */
1086 static final CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = new Co mpileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 12, "'%s' cannot be used to name a type varaible in a class with the same name"); 1048 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 12, "'%s' canno t be used to name a type varaible in a class with the same name");
1087 1049
1088 /** 1050 /**
1089 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the 1051 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the
1090 * same name as the class or any of its members or constructors. 1052 * same name as the class or any of its members or constructors.
1091 */ 1053 */
1092 static final CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = new C ompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 13, "'%s' canno t be used to name a type varaible and member in this class"); 1054 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 13, "'%s' can not be used to name a type varaible and member in this class");
1093 1055
1094 /** 1056 /**
1095 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1057 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1096 * uncaught exception being thrown. 1058 * uncaught exception being thrown.
1097 */ 1059 */
1098 static final CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = new Com pileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 14, "'const' constr uctors cannot throw exceptions"); 1060 static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const C ompileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 14, "'const' cons tructors cannot throw exceptions");
1099 1061
1100 /** 1062 /**
1101 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in 1063 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in
1102 * the initializer list of a constant constructor must specify a constant cons tructor of the 1064 * the initializer list of a constant constructor must specify a constant cons tructor of the
1103 * superclass of the immediately enclosing class or a compile-time error occur s. 1065 * superclass of the immediately enclosing class or a compile-time error occur s.
1104 */ 1066 */
1105 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = new CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 15, "Consta nt constructor cannot call non-constant super constructor"); 1067 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = con st CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 15, "Cons tant constructor cannot call non-constant super constructor");
1106 1068
1107 /** 1069 /**
1108 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const ructor is declared 1070 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const ructor is declared
1109 * by a class that has a non-final instance variable. 1071 * by a class that has a non-final instance variable.
1110 * 1072 *
1111 * The above refers to both locally declared and inherited instance variables. 1073 * The above refers to both locally declared and inherited instance variables.
1112 */ 1074 */
1113 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 16, "Cannot define the 'const' constructor for a class with non-final fields"); 1075 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = con st CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 16, "Cann ot define the 'const' constructor for a class with non-final fields");
1114 1076
1115 /** 1077 /**
1116 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not 1078 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
1117 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of 1079 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of
1118 * the field <i>v</i>. 1080 * the field <i>v</i>.
1119 * 1081 *
1120 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1082 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1121 * uncaught exception being thrown. 1083 * uncaught exception being thrown.
1122 * 1084 *
1123 * @param initializerType the name of the type of the initializer expression 1085 * @param initializerType the name of the type of the initializer expression
1124 * @param fieldType the name of the type of the field 1086 * @param fieldType the name of the type of the field
1125 */ 1087 */
1126 static final CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = new CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 17, "The in itializer type '%s' cannot be assigned to the field type '%s'"); 1088 static const CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = con st CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 17, "The initializer type '%s' cannot be assigned to the field type '%s'");
1127 1089
1128 /** 1090 /**
1129 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a 1091 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a
1130 * constant variable. 1092 * constant variable.
1131 */ 1093 */
1132 static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErro rCode.con1('CONST_FORMAL_PARAMETER', 18, "Parameters cannot be 'const'"); 1094 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode.con1('CONST_FORMAL_PARAMETER', 18, "Parameters cannot be 'const'");
1133 1095
1134 /** 1096 /**
1135 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a 1097 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a
1136 * compile-time error occurs. 1098 * compile-time error occurs.
1137 */ 1099 */
1138 static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = new CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 19, " 'const' variables must be constant value"); 1100 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 19, "'const' variables must be constant value");
1139 1101
1140 /** 1102 /**
1141 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be 1103 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be
1142 * constant. 1104 * constant.
1143 */ 1105 */
1144 static final CompileTimeErrorCode CONST_INSTANCE_FIELD = new CompileTimeErrorC ode.con1('CONST_INSTANCE_FIELD', 20, "Only static fields can be declared as 'con st'"); 1106 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode.con1('CONST_INSTANCE_FIELD', 20, "Only static fields can be declared as 'c onst'");
1145 1107
1146 /** 1108 /**
1147 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an 1109 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an
1148 * instance of a class that implements the operator <i>==</i> unless the key i s a string or 1110 * instance of a class that implements the operator <i>==</i> unless the key i s a string or
1149 * integer. 1111 * integer.
1150 */ 1112 */
1151 static final CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = new CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQ UALS', 21, "The constant map entry key expression type '%s' cannot override the == operator"); 1113 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = const CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_ EQUALS', 21, "The constant map entry key expression type '%s' cannot override th e == operator");
1152 1114
1153 /** 1115 /**
1154 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a 1116 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a
1155 * compile-time error occurs. 1117 * compile-time error occurs.
1156 * 1118 *
1157 * @param name the name of the uninitialized final variable 1119 * @param name the name of the uninitialized final variable
1158 */ 1120 */
1159 static final CompileTimeErrorCode CONST_NOT_INITIALIZED = new CompileTimeError Code.con1('CONST_NOT_INITIALIZED', 22, "The const variable '%s' must be initiali zed"); 1121 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode.con1('CONST_NOT_INITIALIZED', 22, "The const variable '%s' must be initia lized");
1160 1122
1161 /** 1123 /**
1162 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2 1124 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2
1163 * are constant expressions that evaluate to a boolean value. 1125 * are constant expressions that evaluate to a boolean value.
1164 */ 1126 */
1165 static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = new CompileTimeErrorC ode.con1('CONST_EVAL_TYPE_BOOL', 23, "An expression of type 'bool' was expected" ); 1127 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode.con1('CONST_EVAL_TYPE_BOOL', 23, "An expression of type 'bool' was expecte d");
1166 1128
1167 /** 1129 /**
1168 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are 1130 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are
1169 * constant expressions that evaluate to a numeric, string or boolean value or to null. 1131 * constant expressions that evaluate to a numeric, string or boolean value or to null.
1170 */ 1132 */
1171 static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = new Compil eTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 24, "An expression of typ e 'bool', 'num', 'String' or 'null' was expected"); 1133 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const Comp ileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 24, "An expression of t ype 'bool', 'num', 'String' or 'null' was expected");
1172 1134
1173 /** 1135 /**
1174 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1 1136 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1
1175 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to 1137 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to
1176 * null. 1138 * null.
1177 */ 1139 */
1178 static final CompileTimeErrorCode CONST_EVAL_TYPE_INT = new CompileTimeErrorCo de.con1('CONST_EVAL_TYPE_INT', 25, "An expression of type 'int' was expected"); 1140 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code.con1('CONST_EVAL_TYPE_INT', 25, "An expression of type 'int' was expected") ;
1179 1141
1180 /** 1142 /**
1181 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/ 1143 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/
1182 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant 1144 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant
1183 * expressions that evaluate to a numeric value or to null.. 1145 * expressions that evaluate to a numeric value or to null..
1184 */ 1146 */
1185 static final CompileTimeErrorCode CONST_EVAL_TYPE_NUM = new CompileTimeErrorCo de.con1('CONST_EVAL_TYPE_NUM', 26, "An expression of type 'num' was expected"); 1147 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code.con1('CONST_EVAL_TYPE_NUM', 26, "An expression of type 'num' was expected") ;
1186 1148
1187 /** 1149 /**
1188 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1150 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1189 * uncaught exception being thrown. 1151 * uncaught exception being thrown.
1190 */ 1152 */
1191 static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTim eErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 27, "Evaluation of this constant expression causes exception"); 1153 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 27, "Evaluation of this constan t expression causes exception");
1192 1154
1193 /** 1155 /**
1194 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1156 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1195 * uncaught exception being thrown. 1157 * uncaught exception being thrown.
1196 */ 1158 */
1197 static final CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = new CompileTimeErr orCode.con1('CONST_EVAL_THROWS_IDBZE', 28, "Evaluation of this constant expressi on throws IntegerDivisionByZeroException"); 1159 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode.con1('CONST_EVAL_THROWS_IDBZE', 28, "Evaluation of this constant expres sion throws IntegerDivisionByZeroException");
1198 1160
1199 /** 1161 /**
1200 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, & hellip;, 1162 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, & hellip;,
1201 * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a 1163 * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a
1202 * generic type with <i>m</i> type parameters. 1164 * generic type with <i>m</i> type parameters.
1203 * 1165 *
1204 * @param typeName the name of the type being referenced (<i>S</i>) 1166 * @param typeName the name of the type being referenced (<i>S</i>)
1205 * @param parameterCount the number of type parameters that were declared 1167 * @param parameterCount the number of type parameters that were declared
1206 * @param argumentCount the number of type arguments provided 1168 * @param argumentCount the number of type arguments provided
1207 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS 1169 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
1208 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS 1170 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
1209 */ 1171 */
1210 static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new Com pileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 29, "The type '%s' is declared with %d type parameters, but %d type arguments were given"); 1172 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C ompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 29, "The type '%s ' is declared with %d type parameters, but %d type arguments were given");
1211 1173
1212 /** 1174 /**
1213 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>, 1175 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>,
1214 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a 1176 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a
1215 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same 1177 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same
1216 * name as the declaration of <i>T</i>. 1178 * name as the declaration of <i>T</i>.
1217 */ 1179 */
1218 static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorC ode.con1('CONST_WITH_NON_CONST', 30, "The constructor being called is not a 'con st' constructor"); 1180 static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErro rCode.con1('CONST_WITH_NON_CONST', 30, "The constructor being called is not a 'c onst' constructor");
1219 1181
1220 /** 1182 /**
1221 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1 1183 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1
1222 * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression. 1184 * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression.
1223 */ 1185 */
1224 static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new Compi leTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 31, "Arguments of a con stant creation must be constant expressions"); 1186 static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const Com pileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 31, "Arguments of a c onstant creation must be constant expressions");
1225 1187
1226 /** 1188 /**
1227 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 1189 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current
1228 * scope, optionally followed by type arguments. 1190 * scope, optionally followed by type arguments.
1229 * 1191 *
1230 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hel lip;, a<sub>n</sub>, 1192 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hel lip;, a<sub>n</sub>,
1231 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub> )</i> it is a 1193 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub> )</i> it is a
1232 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally 1194 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally
1233 * followed by type arguments. 1195 * followed by type arguments.
1234 * 1196 *
1235 * @param name the name of the non-type element 1197 * @param name the name of the non-type element
1236 */ 1198 */
1237 static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCo de.con1('CONST_WITH_NON_TYPE', 32, "The name '%s' is not a class"); 1199 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code.con1('CONST_WITH_NON_TYPE', 32, "The name '%s' is not a class");
1238 1200
1239 /** 1201 /**
1240 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters. 1202 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters.
1241 */ 1203 */
1242 static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTime ErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 33, "The constant creation cannot u se a type parameter"); 1204 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 33, "The constant creation cannot use a type parameter");
1243 1205
1244 /** 1206 /**
1245 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant 1207 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
1246 * constructor declared by the type <i>T</i>. 1208 * constructor declared by the type <i>T</i>.
1247 * 1209 *
1248 * @param typeName the name of the type 1210 * @param typeName the name of the type
1249 * @param constructorName the name of the requested constant constructor 1211 * @param constructorName the name of the requested constant constructor
1250 */ 1212 */
1251 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new Compi leTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 34, "The class '%s' doe s not have a constant constructor '%s'"); 1213 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const Com pileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 34, "The class '%s' d oes not have a constant constructor '%s'");
1252 1214
1253 /** 1215 /**
1254 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant 1216 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
1255 * constructor declared by the type <i>T</i>. 1217 * constructor declared by the type <i>T</i>.
1256 * 1218 *
1257 * @param typeName the name of the type 1219 * @param typeName the name of the type
1258 */ 1220 */
1259 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = n ew CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 35, "Th e class '%s' does not have a default constant constructor"); 1221 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = c onst CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 35, " The class '%s' does not have a default constant constructor");
1260 1222
1261 /** 1223 /**
1262 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature 1224 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature
1263 * of a function type alias. 1225 * of a function type alias.
1264 */ 1226 */
1265 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new C ompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 36, "Default va lues aren't allowed in typedefs"); 1227 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 36, "Default values aren't allowed in typedefs");
1266 1228
1267 /** 1229 /**
1268 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes 1230 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes
1269 * its type as a function type. It is a compile-time error if any default valu es are specified in 1231 * its type as a function type. It is a compile-time error if any default valu es are specified in
1270 * the signature of such a function type. 1232 * the signature of such a function type.
1271 */ 1233 */
1272 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = new CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 37, " Default values aren't allowed in function type parameters"); 1234 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 37, "Default values aren't allowed in function type parameters");
1273 1235
1274 /** 1236 /**
1275 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value 1237 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value
1276 * for an optional parameter. 1238 * for an optional parameter.
1277 */ 1239 */
1278 static final CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = new CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONST RUCTOR', 38, "Default values aren't allowed in factory constructors that redirec t to another constructor"); 1240 static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CON STRUCTOR', 38, "Default values aren't allowed in factory constructors that redir ect to another constructor");
1279 1241
1280 /** 1242 /**
1281 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 1243 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name
1282 * declared in the same scope. 1244 * declared in the same scope.
1283 */ 1245 */
1284 static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = new CompileT imeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 39, "The default constructor is already defined"); 1246 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 39, "The default constructo r is already defined");
1285 1247
1286 /** 1248 /**
1287 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 1249 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name
1288 * declared in the same scope. 1250 * declared in the same scope.
1289 * 1251 *
1290 * @param duplicateName the name of the duplicate entity 1252 * @param duplicateName the name of the duplicate entity
1291 */ 1253 */
1292 static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = new CompileTime ErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 40, "The constructor with name '%s' is already defined"); 1254 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 40, "The constructor with name '% s' is already defined");
1293 1255
1294 /** 1256 /**
1295 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 1257 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name
1296 * declared in the same scope. 1258 * declared in the same scope.
1297 * 1259 *
1298 * 7 Classes: It is a compile-time error if a class declares two members of th e same name. 1260 * 7 Classes: It is a compile-time error if a class declares two members of th e same name.
1299 * 1261 *
1300 * 7 Classes: It is a compile-time error if a class has an instance member and a static member 1262 * 7 Classes: It is a compile-time error if a class has an instance member and a static member
1301 * with the same name. 1263 * with the same name.
1302 * 1264 *
1303 * @param duplicateName the name of the duplicate entity 1265 * @param duplicateName the name of the duplicate entity
1304 */ 1266 */
1305 static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorC ode.con1('DUPLICATE_DEFINITION', 41, "The name '%s' is already defined"); 1267 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode.con1('DUPLICATE_DEFINITION', 41, "The name '%s' is already defined");
1306 1268
1307 /** 1269 /**
1308 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member 1270 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member
1309 * with the same name. 1271 * with the same name.
1310 * 1272 *
1311 * This covers the additional duplicate definition cases where inheritance has to be considered. 1273 * This covers the additional duplicate definition cases where inheritance has to be considered.
1312 * 1274 *
1313 * @param className the name of the class that has conflicting instance/static members 1275 * @param className the name of the class that has conflicting instance/static members
1314 * @param name the name of the conflicting members 1276 * @param name the name of the conflicting members
1315 * @see #DUPLICATE_DEFINITION 1277 * @see #DUPLICATE_DEFINITION
1316 */ 1278 */
1317 static final CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = new Compi leTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 42, "The name '%s' is a lready defined in '%s'"); 1279 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 42, "The name '%s' is already defined in '%s'");
1318 1280
1319 /** 1281 /**
1320 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> = 1282 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> =
1321 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named 1283 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named
1322 * argument]. 1284 * argument].
1323 */ 1285 */
1324 static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeEr rorCode.con1('DUPLICATE_NAMED_ARGUMENT', 43, "The argument for the named paramet er '%s' was already specified"); 1286 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime ErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 43, "The argument for the named param eter '%s' was already specified");
1325 1287
1326 /** 1288 /**
1327 * SDK implementation libraries can be exported only by other SDK libraries. 1289 * SDK implementation libraries can be exported only by other SDK libraries.
1328 * 1290 *
1329 * @param uri the uri pointing to a library 1291 * @param uri the uri pointing to a library
1330 */ 1292 */
1331 static final CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = new CompileTimeErr orCode.con1('EXPORT_INTERNAL_LIBRARY', 44, "The library '%s' is internal and can not be exported"); 1293 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('EXPORT_INTERNAL_LIBRARY', 44, "The library '%s' is internal and c annot be exported");
1332 1294
1333 /** 1295 /**
1334 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1296 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
1335 * not a library declaration. 1297 * not a library declaration.
1336 * 1298 *
1337 * @param uri the uri pointing to a non-library declaration 1299 * @param uri the uri pointing to a non-library declaration
1338 */ 1300 */
1339 static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeError Code.con1('EXPORT_OF_NON_LIBRARY', 45, "The exported library '%s' must not have a part-of directive"); 1301 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('EXPORT_OF_NON_LIBRARY', 45, "The exported library '%s' must not hav e a part-of directive");
1340 1302
1341 /** 1303 /**
1342 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes 1304 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes
1343 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>. 1305 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>.
1344 * 1306 *
1345 * @param typeName the name of the superclass that was not found 1307 * @param typeName the name of the superclass that was not found
1346 */ 1308 */
1347 static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode .con1('EXTENDS_NON_CLASS', 46, "Classes can only extend other classes"); 1309 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de.con1('EXTENDS_NON_CLASS', 46, "Classes can only extend other classes");
1348 1310
1349 /** 1311 /**
1350 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1312 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
1351 * 1313 *
1352 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1314 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
1353 * 1315 *
1354 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1316 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
1355 * 1317 *
1356 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1318 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
1357 * attempt to extend or implement num. 1319 * attempt to extend or implement num.
1358 * 1320 *
1359 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1321 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
1360 * 1322 *
1361 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1323 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
1362 * 1324 *
1363 * @param typeName the name of the type that cannot be extended 1325 * @param typeName the name of the type that cannot be extended
1364 * @see #IMPLEMENTS_DISALLOWED_CLASS 1326 * @see #IMPLEMENTS_DISALLOWED_CLASS
1365 */ 1327 */
1366 static final CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = new CompileTimeEr rorCode.con1('EXTENDS_DISALLOWED_CLASS', 47, "Classes cannot extend '%s'"); 1328 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 47, "Classes cannot extend '%s'");
1367 1329
1368 /** 1330 /**
1369 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 1331 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt;
1370 * n</i>. 1332 * n</i>.
1371 * 1333 *
1372 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1334 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1373 * uncaught exception being thrown. 1335 * uncaught exception being thrown.
1374 * 1336 *
1375 * @param requiredCount the maximum number of positional arguments 1337 * @param requiredCount the maximum number of positional arguments
1376 * @param argumentCount the actual number of positional arguments given 1338 * @param argumentCount the actual number of positional arguments given
1377 */ 1339 */
1378 static final CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = new CompileTime ErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 48, "%d positional arguments expect ed, but %d found"); 1340 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 48, "%d positional arguments expe cted, but %d found");
1379 1341
1380 /** 1342 /**
1381 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time 1343 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
1382 * error if more than one initializer corresponding to a given instance variab le appears in 1344 * error if more than one initializer corresponding to a given instance variab le appears in
1383 * <i>k</i>'s list. 1345 * <i>k</i>'s list.
1384 */ 1346 */
1385 static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = new CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 49, "The field '%s' cannot be initialized twice in the same constructor"); 1347 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 4 9, "The field '%s' cannot be initialized twice in the same constructor");
1386 1348
1387 /** 1349 /**
1388 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time 1350 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
1389 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized 1351 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized
1390 * by means of an initializing formal of <i>k</i>. 1352 * by means of an initializing formal of <i>k</i>.
1391 */ 1353 */
1392 static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = new CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER', 50, "Fields cannot be initialized in both the parameter list and the initia lizers"); 1354 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIAL IZER', 50, "Fields cannot be initialized in both the parameter list and the init ializers");
1393 1355
1394 /** 1356 /**
1395 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by 1357 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by
1396 * means of an initializing formal of a constructor is also initialized elsewh ere in the same 1358 * means of an initializing formal of a constructor is also initialized elsewh ere in the same
1397 * constructor. 1359 * constructor.
1398 * 1360 *
1399 * @param name the name of the field in question 1361 * @param name the name of the field in question
1400 */ 1362 */
1401 static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new Compi leTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 51, "'%s' is a final fi eld and so can only be set once"); 1363 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const Com pileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 51, "'%s' is a final field and so can only be set once");
1402 1364
1403 /** 1365 /**
1404 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 1366 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by
1405 * a function other than a non-redirecting generative constructor. 1367 * a function other than a non-redirecting generative constructor.
1406 */ 1368 */
1407 static final CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = new CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 52, "Initiali zing formal fields cannot be used in factory constructors"); 1369 static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 52, "Initia lizing formal fields cannot be used in factory constructors");
1408 1370
1409 /** 1371 /**
1410 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 1372 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by
1411 * a function other than a non-redirecting generative constructor. 1373 * a function other than a non-redirecting generative constructor.
1412 */ 1374 */
1413 static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 53, "Initiali zing formal fields can only be used in constructors"); 1375 static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 53, "Initia lizing formal fields can only be used in constructors");
1414 1376
1415 /** 1377 /**
1416 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1378 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1417 * only action is to invoke another generative constructor. 1379 * only action is to invoke another generative constructor.
1418 * 1380 *
1419 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 1381 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by
1420 * a function other than a non-redirecting generative constructor. 1382 * a function other than a non-redirecting generative constructor.
1421 */ 1383 */
1422 static final CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = new CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 54, " The redirecting constructor cannot have a field initializer"); 1384 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 54, "The redirecting constructor cannot have a field initializer");
1423 1385
1424 /** 1386 /**
1425 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1387 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
1426 * name. 1388 * name.
1427 * 1389 *
1428 * @param name the conflicting name of the getter and method 1390 * @param name the conflicting name of the getter and method
1429 */ 1391 */
1430 static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new Compi leTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 55, "'%s' cannot be use d to name a getter, there is already a method with the same name"); 1392 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 55, "'%s' cannot be u sed to name a getter, there is already a method with the same name");
1431 1393
1432 /** 1394 /**
1433 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1395 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
1434 * 1396 *
1435 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1397 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
1436 * 1398 *
1437 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1399 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
1438 * 1400 *
1439 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1401 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
1440 * attempt to extend or implement num. 1402 * attempt to extend or implement num.
1441 * 1403 *
1442 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1404 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
1443 * 1405 *
1444 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1406 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
1445 * 1407 *
1446 * @param typeName the name of the type that cannot be implemented 1408 * @param typeName the name of the type that cannot be implemented
1447 * @see #EXTENDS_DISALLOWED_CLASS 1409 * @see #EXTENDS_DISALLOWED_CLASS
1448 */ 1410 */
1449 static final CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = new CompileTim eErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 56, "Classes cannot implement '%s '"); 1411 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 56, "Classes cannot implement ' %s'");
1450 1412
1451 /** 1413 /**
1452 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes 1414 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes
1453 * type dynamic. 1415 * type dynamic.
1454 */ 1416 */
1455 static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCod e.con1('IMPLEMENTS_DYNAMIC', 57, "Classes cannot implement 'dynamic'"); 1417 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode.con1('IMPLEMENTS_DYNAMIC', 57, "Classes cannot implement 'dynamic'");
1456 1418
1457 /** 1419 /**
1458 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> 1420 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i>
1459 * includes a type expression that does not denote a class available in the le xical scope of 1421 * includes a type expression that does not denote a class available in the le xical scope of
1460 * <i>C</i>. 1422 * <i>C</i>.
1461 * 1423 *
1462 * @param typeName the name of the interface that was not found 1424 * @param typeName the name of the interface that was not found
1463 */ 1425 */
1464 static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorC ode.con1('IMPLEMENTS_NON_CLASS', 58, "Classes can only implement other classes") ; 1426 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode.con1('IMPLEMENTS_NON_CLASS', 58, "Classes can only implement other classes ");
1465 1427
1466 /** 1428 /**
1467 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in 1429 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in
1468 * the implements clause of a class. 1430 * the implements clause of a class.
1469 * 1431 *
1470 * @param className the name of the class that is implemented more than once 1432 * @param className the name of the class that is implemented more than once
1471 */ 1433 */
1472 static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCo de.con1('IMPLEMENTS_REPEATED', 59, "'%s' can only be implemented once"); 1434 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code.con1('IMPLEMENTS_REPEATED', 59, "'%s' can only be implemented once");
1473 1435
1474 /** 1436 /**
1475 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears 1437 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears
1476 * in the implements clause of <i>C</i>. 1438 * in the implements clause of <i>C</i>.
1477 * 1439 *
1478 * @param className the name of the class that appears in both "extends" and " implements" clauses 1440 * @param className the name of the class that appears in both "extends" and " implements" clauses
1479 */ 1441 */
1480 static final CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = new CompileTimeErro rCode.con1('IMPLEMENTS_SUPER_CLASS', 60, "'%s' cannot be used in both 'extends' and 'implements' clauses"); 1442 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeEr rorCode.con1('IMPLEMENTS_SUPER_CLASS', 60, "'%s' cannot be used in both 'extends ' and 'implements' clauses");
1481 1443
1482 /** 1444 /**
1483 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of 1445 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of
1484 * an initializer. 1446 * an initializer.
1485 * 1447 *
1486 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1448 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable
1487 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1449 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the
1488 * initializer of an instance variable. 1450 * initializer of an instance variable.
1489 * 1451 *
1490 * @param name the name of the type in question 1452 * @param name the name of the type in question
1491 */ 1453 */
1492 static final CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = new CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 61, "Only s tatic members can be accessed in initializers"); 1454 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = con st CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 61, "Only static members can be accessed in initializers");
1493 1455
1494 /** 1456 /**
1495 * SDK implementation libraries can be imported only by other SDK libraries. 1457 * SDK implementation libraries can be imported only by other SDK libraries.
1496 * 1458 *
1497 * @param uri the uri pointing to a library 1459 * @param uri the uri pointing to a library
1498 */ 1460 */
1499 static final CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = new CompileTimeErr orCode.con1('IMPORT_INTERNAL_LIBRARY', 62, "The library '%s' is internal and can not be imported"); 1461 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('IMPORT_INTERNAL_LIBRARY', 62, "The library '%s' is internal and c annot be imported");
1500 1462
1501 /** 1463 /**
1502 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1464 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
1503 * not a library declaration. 1465 * not a library declaration.
1504 * 1466 *
1505 * @param uri the uri pointing to a non-library declaration 1467 * @param uri the uri pointing to a non-library declaration
1506 */ 1468 */
1507 static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeError Code.con1('IMPORT_OF_NON_LIBRARY', 63, "The imported library '%s' must not have a part-of directive"); 1469 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('IMPORT_OF_NON_LIBRARY', 63, "The imported library '%s' must not hav e a part-of directive");
1508 1470
1509 /** 1471 /**
1510 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are 1472 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are
1511 * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>. 1473 * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>.
1512 * 1474 *
1513 * @param expressionSource the expression source code that is the unexpected t ype 1475 * @param expressionSource the expression source code that is the unexpected t ype
1514 * @param expectedType the name of the expected type 1476 * @param expectedType the name of the expected type
1515 */ 1477 */
1516 static final CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = new Com pileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 64, "Case expressio ns must have the same types, '%s' is not a %s'"); 1478 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C ompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 64, "Case express ions must have the same types, '%s' is not a %s'");
1517 1479
1518 /** 1480 /**
1519 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1481 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
1520 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an 1482 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
1521 * instance variable declared in the immediately surrounding class. 1483 * instance variable declared in the immediately surrounding class.
1522 * 1484 *
1523 * @param id the name of the initializing formal that is not an instance varia ble in the 1485 * @param id the name of the initializing formal that is not an instance varia ble in the
1524 * immediately enclosing class 1486 * immediately enclosing class
1525 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD 1487 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD
1526 */ 1488 */
1527 static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new Com pileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 65, "'%s' is not a variable in the enclosing class"); 1489 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = const C ompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 65, "'%s' is not a variable in the enclosing class");
1528 1490
1529 /** 1491 /**
1530 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1492 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
1531 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an 1493 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
1532 * instance variable declared in the immediately surrounding class. 1494 * instance variable declared in the immediately surrounding class.
1533 * 1495 *
1534 * @param id the name of the initializing formal that is a static variable in the immediately 1496 * @param id the name of the initializing formal that is a static variable in the immediately
1535 * enclosing class 1497 * enclosing class
1536 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD 1498 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
1537 */ 1499 */
1538 static final CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = new CompileTi meErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 66, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static" ); 1500 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile TimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 66, "'%s' is a static variabl e in the enclosing class, variables initialized in a constructor cannot be stati c");
1539 1501
1540 /** 1502 /**
1541 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 1503 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a
1542 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately 1504 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
1543 * enclosing class. 1505 * enclosing class.
1544 * 1506 *
1545 * @param id the name of the initializing formal that is not an instance varia ble in the 1507 * @param id the name of the initializing formal that is not an instance varia ble in the
1546 * immediately enclosing class 1508 * immediately enclosing class
1547 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD 1509 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
1548 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD 1510 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD
1549 */ 1511 */
1550 static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = new CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 67, "'%s' is not a variable in the enclosing class"); 1512 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 6 7, "'%s' is not a variable in the enclosing class");
1551 1513
1552 /** 1514 /**
1553 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 1515 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a
1554 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately 1516 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
1555 * enclosing class. 1517 * enclosing class.
1556 * 1518 *
1557 * @param id the name of the initializing formal that is a static variable in the immediately 1519 * @param id the name of the initializing formal that is a static variable in the immediately
1558 * enclosing class 1520 * enclosing class
1559 * @see #INITIALIZER_FOR_STATIC_FIELD 1521 * @see #INITIALIZER_FOR_STATIC_FIELD
1560 */ 1522 */
1561 static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = new C ompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 68, "'%s' is a static variable in the enclosing class, variables initialized in a constructor c annot be static"); 1523 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 68, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
1562 1524
1563 /** 1525 /**
1564 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action 1526 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action
1565 * <b>this</b>.<i>id</i>. 1527 * <b>this</b>.<i>id</i>.
1566 */ 1528 */
1567 static final CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = new Com pileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 69, "Instance membe r cannot be accessed from static method"); 1529 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 69, "Instance mem ber cannot be accessed from static method");
1568 1530
1569 /** 1531 /**
1570 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1532 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1571 * character @, followed by a constant expression that must be either a refere nce to a 1533 * character @, followed by a constant expression that must be either a refere nce to a
1572 * compile-time constant variable, or a call to a constant constructor. 1534 * compile-time constant variable, or a call to a constant constructor.
1573 */ 1535 */
1574 static final CompileTimeErrorCode INVALID_ANNOTATION = new CompileTimeErrorCod e.con1('INVALID_ANNOTATION', 70, "Annotation can be only constant variable or co nstant constructor invocation"); 1536 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 70, "Annotation can be only constant variable or constant constructor invocation");
1575 1537
1576 /** 1538 /**
1577 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time 1539 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time
1578 * constants. Until then, this acts as a placeholder for more informative erro rs. 1540 * constants. Until then, this acts as a placeholder for more informative erro rs.
1579 * 1541 *
1580 * See TODOs in ConstantVisitor 1542 * See TODOs in ConstantVisitor
1581 */ 1543 */
1582 static final CompileTimeErrorCode INVALID_CONSTANT = new CompileTimeErrorCode. con1('INVALID_CONSTANT', 71, "Invalid constant value"); 1544 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 71, "Invalid constant value");
1583 1545
1584 /** 1546 /**
1585 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor 1547 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor
1586 * name. 1548 * name.
1587 */ 1549 */
1588 static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeEr rorCode.con1('INVALID_CONSTRUCTOR_NAME', 72, "Invalid constructor name"); 1550 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 72, "Invalid constructor name");
1589 1551
1590 /** 1552 /**
1591 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately 1553 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately
1592 * enclosing class. 1554 * enclosing class.
1593 */ 1555 */
1594 static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new Compi leTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 73, "The name of the im mediately enclosing class expected"); 1556 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 73, "The name of the immediately enclosing class expected");
1595 1557
1596 /** 1558 /**
1597 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1559 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable
1598 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1560 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the
1599 * initializer of an instance variable. 1561 * initializer of an instance variable.
1600 */ 1562 */
1601 static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeE rrorCode.con1('INVALID_REFERENCE_TO_THIS', 74, "Invalid reference to 'this' expr ession"); 1563 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 74, "Invalid reference to 'this' ex pression");
1602 1564
1603 /** 1565 /**
1604 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes 1566 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes
1605 * a type parameter. 1567 * a type parameter.
1606 * 1568 *
1607 * @name the name of the type parameter 1569 * @name the name of the type parameter
1608 */ 1570 */
1609 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new Co mpileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 75, "Constant lis t literals cannot include a type parameter as a type argument, such as '%s'"); 1571 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 75, "Constant l ist literals cannot include a type parameter as a type argument, such as '%s'");
1610 1572
1611 /** 1573 /**
1612 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a 1574 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a
1613 * type parameter. 1575 * type parameter.
1614 * 1576 *
1615 * @name the name of the type parameter 1577 * @name the name of the type parameter
1616 */ 1578 */
1617 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new Com pileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 76, "Constant map l iterals cannot include a type parameter as a type argument, such as '%s'"); 1579 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 76, "Constant map literals cannot include a type parameter as a type argument, such as '%s'");
1618 1580
1619 /** 1581 /**
1620 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1582 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
1621 * not a library declaration. 1583 * not a library declaration.
1622 * 1584 *
1623 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1585 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
1624 * not a library declaration. 1586 * not a library declaration.
1625 * 1587 *
1626 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1588 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1627 * declaration. 1589 * declaration.
1628 * 1590 *
1629 * @param uri the URI that is invalid 1591 * @param uri the URI that is invalid
1630 * @see #URI_DOES_NOT_EXIST 1592 * @see #URI_DOES_NOT_EXIST
1631 */ 1593 */
1632 static final CompileTimeErrorCode INVALID_URI = new CompileTimeErrorCode.con1( 'INVALID_URI', 77, "Invalid URI syntax: '%s'"); 1594 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 77, "Invalid URI syntax: '%s'");
1633 1595
1634 /** 1596 /**
1635 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1597 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within
1636 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1598 * the innermost function in which <i>s<sub>b</sub></i> occurs.
1637 * 1599 *
1638 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1600 * 13.14 Continue: It is a compile-time error if no such statement or case cla use
1639 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1601 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs.
1640 * 1602 *
1641 * @param labelName the name of the unresolvable label 1603 * @param labelName the name of the unresolvable label
1642 */ 1604 */
1643 static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorC ode.con1('LABEL_IN_OUTER_SCOPE', 78, "Cannot reference label '%s' declared in an outer method"); 1605 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1('LABEL_IN_OUTER_SCOPE', 78, "Cannot reference label '%s' declared in an outer method");
1644 1606
1645 /** 1607 /**
1646 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1608 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within
1647 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1609 * the innermost function in which <i>s<sub>b</sub></i> occurs.
1648 * 1610 *
1649 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1611 * 13.14 Continue: It is a compile-time error if no such statement or case cla use
1650 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1612 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs.
1651 * 1613 *
1652 * @param labelName the name of the unresolvable label 1614 * @param labelName the name of the unresolvable label
1653 */ 1615 */
1654 static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode.c on1('LABEL_UNDEFINED', 79, "Cannot reference undefined label '%s'"); 1616 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 79, "Cannot reference undefined label '%s'");
1655 1617
1656 /** 1618 /**
1657 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ... 1619 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
1658 * <i>e<sub>n</sub></i>] is evaluated as follows: 1620 * <i>e<sub>n</sub></i>] is evaluated as follows:
1659 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument 1621 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
1660 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i> 1622 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
1661 * 1623 *
1662 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 1624 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1663 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 1625 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
1664 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 1626 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
1665 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 1627 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1666 * j &lt;= m</i>. 1628 * j &lt;= m</i>.
1667 */ 1629 */
1668 static final CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new Compi leTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 80, "The element type ' %s' cannot be assigned to the list type '%s'"); 1630 static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Com pileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 80, "The element type '%s' cannot be assigned to the list type '%s'");
1669 1631
1670 /** 1632 /**
1671 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 1633 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
1672 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 1634 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
1673 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 1635 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
1674 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 1636 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
1675 * 1637 *
1676 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 1638 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1677 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 1639 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
1678 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 1640 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
1679 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 1641 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1680 * j &lt;= m</i>. 1642 * j &lt;= m</i>.
1681 */ 1643 */
1682 static final CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new CompileTim eErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 81, "The element type '%s' cannot be assigned to the map key type '%s'"); 1644 static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileT imeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 81, "The element type '%s' cann ot be assigned to the map key type '%s'");
1683 1645
1684 /** 1646 /**
1685 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 1647 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
1686 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 1648 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
1687 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 1649 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
1688 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 1650 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
1689 * 1651 *
1690 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 1652 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1691 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 1653 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
1692 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 1654 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
1693 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 1655 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1694 * j &lt;= m</i>. 1656 * j &lt;= m</i>.
1695 */ 1657 */
1696 static final CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new CompileT imeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 82, "The element type '%s' ca nnot be assigned to the map value type '%s'"); 1658 static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const Compil eTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 82, "The element type '%s' cannot be assigned to the map value type '%s'");
1697 1659
1698 /** 1660 /**
1699 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name 1661 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name
1700 * as <i>C</i>. 1662 * as <i>C</i>.
1701 */ 1663 */
1702 static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErro rCode.con1('MEMBER_WITH_CLASS_NAME', 83, "Class members cannot have the same nam e as the enclosing class"); 1664 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1('MEMBER_WITH_CLASS_NAME', 83, "Class members cannot have the same n ame as the enclosing class");
1703 1665
1704 /** 1666 /**
1705 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1667 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
1706 * name. 1668 * name.
1707 * 1669 *
1708 * @param name the conflicting name of the getter and method 1670 * @param name the conflicting name of the getter and method
1709 */ 1671 */
1710 static final CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = new Compi leTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 84, "'%s' cannot be use d to name a method, there is already a getter with the same name"); 1672 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 84, "'%s' cannot be u sed to name a method, there is already a getter with the same name");
1711 1673
1712 /** 1674 /**
1713 * 12.1 Constants: A constant expression is ... a constant list literal. 1675 * 12.1 Constants: A constant expression is ... a constant list literal.
1714 */ 1676 */
1715 static final CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = new CompileT imeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 85, "List literals must be pr efixed with 'const' when used as a constant expression"); 1677 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 85, "List literals must be prefixed with 'const' when used as a constant expression");
1716 1678
1717 /** 1679 /**
1718 * 12.1 Constants: A constant expression is ... a constant map literal. 1680 * 12.1 Constants: A constant expression is ... a constant map literal.
1719 */ 1681 */
1720 static final CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = new CompileTi meErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 86, "Map literals must be prefi xed with 'const' when used as a constant expression"); 1682 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 86, "Map literals must be pre fixed with 'const' when used as a constant expression");
1721 1683
1722 /** 1684 /**
1723 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a 1685 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a
1724 * constructor. 1686 * constructor.
1725 * 1687 *
1726 * @param typeName the name of the mixin that is invalid 1688 * @param typeName the name of the mixin that is invalid
1727 */ 1689 */
1728 static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTime ErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 87, "The class '%s' cannot be used as a mixin because it declares a constructor"); 1690 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 87, "The class '%s' cannot be use d as a mixin because it declares a constructor");
1729 1691
1730 /** 1692 /**
1731 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not 1693 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not
1732 * Object. 1694 * Object.
1733 * 1695 *
1734 * @param typeName the name of the mixin that is invalid 1696 * @param typeName the name of the mixin that is invalid
1735 */ 1697 */
1736 static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new Compile TimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 88, "The class '%s' cannot be used as a mixin because it extends a class other than Object"); 1698 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 88, "The class '%s' canno t be used as a mixin because it extends a class other than Object");
1737 1699
1738 /** 1700 /**
1739 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1701 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
1740 * 1702 *
1741 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1703 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
1742 * 1704 *
1743 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1705 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
1744 * 1706 *
1745 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1707 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
1746 * attempt to extend or implement num. 1708 * attempt to extend or implement num.
1747 * 1709 *
1748 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1710 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
1749 * 1711 *
1750 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1712 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
1751 * 1713 *
1752 * @param typeName the name of the type that cannot be extended 1714 * @param typeName the name of the type that cannot be extended
1753 * @see #IMPLEMENTS_DISALLOWED_CLASS 1715 * @see #IMPLEMENTS_DISALLOWED_CLASS
1754 */ 1716 */
1755 static final CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = new CompileTimeE rrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 89, "Classes cannot mixin '%s'"); 1717 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 89, "Classes cannot mixin '%s'");
1756 1718
1757 /** 1719 /**
1758 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin 1720 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin
1759 * available in the immediately enclosing scope. 1721 * available in the immediately enclosing scope.
1760 */ 1722 */
1761 static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCod e.con1('MIXIN_OF_NON_CLASS', 90, "Classes can only mixin other classes"); 1723 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 90, "Classes can only mixin other classes");
1762 1724
1763 /** 1725 /**
1764 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super. 1726 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super.
1765 */ 1727 */
1766 static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErro rCode.con1('MIXIN_REFERENCES_SUPER', 91, "The class '%s' cannot be used as a mix in because it references 'super'"); 1728 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1('MIXIN_REFERENCES_SUPER', 91, "The class '%s' cannot be used as a m ixin because it references 'super'");
1767 1729
1768 /** 1730 /**
1769 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available 1731 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available
1770 * in the immediately enclosing scope. 1732 * in the immediately enclosing scope.
1771 */ 1733 */
1772 static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new Compil eTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 92, "Mixin can only be ap plied to class"); 1734 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 92, "Mixin can only be applied to class");
1773 1735
1774 /** 1736 /**
1775 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1737 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1776 * only action is to invoke another generative constructor. 1738 * only action is to invoke another generative constructor.
1777 */ 1739 */
1778 static final CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = new CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', 93, "Constructor may have at most one 'this' redirection"); 1740 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 93, "Constructor may have at most one 'this' redirection");
1779 1741
1780 /** 1742 /**
1781 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may 1743 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may
1782 * include at most one superinitializer in its initializer list or a compile t ime error occurs. 1744 * include at most one superinitializer in its initializer list or a compile t ime error occurs.
1783 */ 1745 */
1784 static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTim eErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 94, "Constructor may have at most one 'super' initializer"); 1746 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 94, "Constructor may have at mo st one 'super' initializer");
1785 1747
1786 /** 1748 /**
1787 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1749 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1788 * character @, followed by a constant expression that must be either a refere nce to a 1750 * character @, followed by a constant expression that must be either a refere nce to a
1789 * compile-time constant variable, or a call to a constant constructor. 1751 * compile-time constant variable, or a call to a constant constructor.
1790 */ 1752 */
1791 static final CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = new Co mpileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 95, "Annotation c reation must have arguments"); 1753 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 95, "Annotation creation must have arguments");
1792 1754
1793 /** 1755 /**
1794 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer 1756 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer
1795 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the 1757 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the
1796 * enclosing class is class <i>Object</i>. 1758 * enclosing class is class <i>Object</i>.
1797 * 1759 *
1798 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1760 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
1799 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1761 * generative constructor named <i>S</i> (respectively <i>S.id</i>)
1800 */ 1762 */
1801 static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = new CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 96, "The clas s '%s' does not have a default constructor"); 1763 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 96, "The cl ass '%s' does not have a default constructor");
1802 1764
1803 /** 1765 /**
1804 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a 1766 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a
1805 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>. 1767 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>.
1806 * 1768 *
1807 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1769 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
1808 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1770 * generative constructor named <i>S</i> (respectively <i>S.id</i>)
1809 */ 1771 */
1810 static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = new CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 97, "The clas s '%s' does not have a default constructor"); 1772 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 97, "The cl ass '%s' does not have a default constructor");
1811 1773
1812 /** 1774 /**
1813 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has 1775 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has
1814 * no explicit type arguments appears in a place where a statement is expected . 1776 * no explicit type arguments appears in a place where a statement is expected .
1815 */ 1777 */
1816 static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 98, "A non-co nstant map literal without type arguments cannot be used as an expression statem ent"); 1778 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 98, "A non- constant map literal without type arguments cannot be used as an expression stat ement");
1817 1779
1818 /** 1780 /**
1819 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1781 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip;
1820 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1782 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip;
1821 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1783 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form
1822 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1784 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>:
1823 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1785 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
1824 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1786 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not
1825 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1787 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1826 */ 1788 */
1827 static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTi meErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 99, "Case expressions must be c onstant"); 1789 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 99, "Case expressions must be constant");
1828 1790
1829 /** 1791 /**
1830 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1792 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
1831 * parameter is not a compile-time constant. 1793 * parameter is not a compile-time constant.
1832 */ 1794 */
1833 static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTime ErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 100, "Default values of an optional parameter must be constant"); 1795 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 100, "Default values of an option al parameter must be constant");
1834 1796
1835 /** 1797 /**
1836 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a 1798 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a
1837 * compile-time constant. 1799 * compile-time constant.
1838 */ 1800 */
1839 static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeE rrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 101, "'const' lists must have all con stant values"); 1801 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 101, "'const' lists must have all c onstant values");
1840 1802
1841 /** 1803 /**
1842 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1804 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1843 * literal is not a compile-time constant. 1805 * literal is not a compile-time constant.
1844 */ 1806 */
1845 static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorC ode.con1('NON_CONSTANT_MAP_KEY', 102, "The keys in a map must be constant"); 1807 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 102, "The keys in a map must be constant");
1846 1808
1847 /** 1809 /**
1848 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1810 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1849 * literal is not a compile-time constant. 1811 * literal is not a compile-time constant.
1850 */ 1812 */
1851 static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErro rCode.con1('NON_CONSTANT_MAP_VALUE', 103, "The values in a 'const' map must be c onstant"); 1813 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1('NON_CONSTANT_MAP_VALUE', 103, "The values in a 'const' map must be constant");
1852 1814
1853 /** 1815 /**
1854 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1816 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1855 * character @, followed by a constant expression that must be either a refere nce to a 1817 * character @, followed by a constant expression that must be either a refere nce to a
1856 * compile-time constant variable, or a call to a constant constructor. 1818 * compile-time constant variable, or a call to a constant constructor.
1857 */ 1819 */
1858 static final CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = new Co mpileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 104, "Annotation creation can use only 'const' constructor"); 1820 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 104, "Annotatio n creation can use only 'const' constructor");
1859 1821
1860 /** 1822 /**
1861 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1823 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a
1862 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1824 * constant constructor must be a potentially constant expression, or a compil e-time error occurs.
1863 */ 1825 */
1864 static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new Comp ileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 105, "Initializer exp ressions in constant constructors must be constants"); 1826 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 105, "Initializer e xpressions in constant constructors must be constants");
1865 1827
1866 /** 1828 /**
1867 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>. 1829 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
1868 * 1830 *
1869 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1831 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1870 * uncaught exception being thrown. 1832 * uncaught exception being thrown.
1871 * 1833 *
1872 * @param requiredCount the expected number of required arguments 1834 * @param requiredCount the expected number of required arguments
1873 * @param argumentCount the actual number of positional arguments given 1835 * @param argumentCount the actual number of positional arguments given
1874 */ 1836 */
1875 static final CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new CompileT imeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 106, "%d required argument(s) expected, but %d found"); 1837 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 106, "%d required argument( s) expected, but %d found");
1876 1838
1877 /** 1839 /**
1878 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1840 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1879 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1841 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1880 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1842 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1881 * (respectively <i>S.id</i>) 1843 * (respectively <i>S.id</i>)
1882 */ 1844 */
1883 static final CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = new CompileTime ErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 107, "The generative constructor '% s' expected, but factory found"); 1845 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 107, "The generative constructor '%s' expected, but factory found");
1884 1846
1885 /** 1847 /**
1886 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object. 1848 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object.
1887 */ 1849 */
1888 static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new Com pileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 108, ""); 1850 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 108, "");
1889 1851
1890 /** 1852 /**
1891 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator. 1853 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator.
1892 */ 1854 */
1893 static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new Compile TimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 109, "Optional parameters a re not allowed when defining an operator"); 1855 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 109, "Optional parameters are not allowed when defining an operator");
1894 1856
1895 /** 1857 /**
1896 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1858 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1897 * declaration. 1859 * declaration.
1898 * 1860 *
1899 * @param uri the uri pointing to a non-library declaration 1861 * @param uri the uri pointing to a non-library declaration
1900 */ 1862 */
1901 static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode. con1('PART_OF_NON_PART', 110, "The included part '%s' must have a part-of direct ive"); 1863 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1('PART_OF_NON_PART', 110, "The included part '%s' must have a part-of dire ctive");
1902 1864
1903 /** 1865 /**
1904 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member 1866 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member
1905 * named <i>p</i>. 1867 * named <i>p</i>.
1906 */ 1868 */
1907 static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 111, "The nam e '%s' is already used as an import prefix and cannot be used to name a top-leve l element"); 1869 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 111, "The n ame '%s' is already used as an import prefix and cannot be used to name a top-le vel element");
1908 1870
1909 /** 1871 /**
1910 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter 1872 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter
1911 * begins with an '_' character. 1873 * begins with an '_' character.
1912 */ 1874 */
1913 static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTime ErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 112, "Named optional parameters can not start with an underscore"); 1875 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 112, "Named optional parameters c annot start with an underscore");
1914 1876
1915 /** 1877 /**
1916 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression 1878 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression
1917 * depends on itself. 1879 * depends on itself.
1918 */ 1880 */
1919 static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new Compil eTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 113, ""); 1881 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 113, "");
1920 1882
1921 /** 1883 /**
1922 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1884 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1923 * only action is to invoke another generative constructor. 1885 * only action is to invoke another generative constructor.
1924 * 1886 *
1925 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in 1887 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in
1926 * specification. But it was added to the co19 and there is same error for fac tories. 1888 * specification. But it was added to the co19 and there is same error for fac tories.
1927 * 1889 *
1928 * https://code.google.com/p/dart/issues/detail?id=954 1890 * https://code.google.com/p/dart/issues/detail?id=954
1929 */ 1891 */
1930 static final CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = new Compile TimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 114, "Cycle in redirecting generative constructors"); 1892 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 114, "Cycle in redirectin g generative constructors");
1931 1893
1932 /** 1894 /**
1933 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to 1895 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to
1934 * itself, either directly or indirectly via a sequence of redirections. 1896 * itself, either directly or indirectly via a sequence of redirections.
1935 */ 1897 */
1936 static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTime ErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 115, "Cycle in redirecting factory constructors"); 1898 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 115, "Cycle in redirecting factor y constructors");
1937 1899
1938 /** 1900 /**
1939 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1901 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1940 * superinterface of itself. 1902 * superinterface of itself.
1941 * 1903 *
1942 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1904 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1943 * 1905 *
1944 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1906 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1945 * 1907 *
1946 * @param className the name of the class that implements itself recursively 1908 * @param className the name of the class that implements itself recursively
1947 * @param strImplementsPath a string representation of the implements loop 1909 * @param strImplementsPath a string representation of the implements loop
1948 */ 1910 */
1949 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new Compil eTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 116, "'%s' cannot be a su perinterface of itself: %s"); 1911 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 116, "'%s' cannot be a superinterface of itself: %s");
1950 1912
1951 /** 1913 /**
1952 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1914 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1953 * superinterface of itself. 1915 * superinterface of itself.
1954 * 1916 *
1955 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1917 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1956 * 1918 *
1957 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1919 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1958 * 1920 *
1959 * @param className the name of the class that implements itself recursively 1921 * @param className the name of the class that implements itself recursively
1960 */ 1922 */
1961 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE _EXTENDS', 117, "'%s' cannot extend itself"); 1923 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS', 117, "'%s' cannot extend itself");
1962 1924
1963 /** 1925 /**
1964 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1926 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1965 * superinterface of itself. 1927 * superinterface of itself.
1966 * 1928 *
1967 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1929 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1968 * 1930 *
1969 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1931 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1970 * 1932 *
1971 * @param className the name of the class that implements itself recursively 1933 * @param className the name of the class that implements itself recursively
1972 */ 1934 */
1973 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_C ASE_IMPLEMENTS', 118, "'%s' cannot implement itself"); 1935 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 118, "'%s' cannot implement itself");
1974 1936
1975 /** 1937 /**
1976 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1938 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1977 * <i>k'</i> is not a constant constructor. 1939 * <i>k'</i> is not a constant constructor.
1978 */ 1940 */
1979 static final CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = new Compil eTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 119, "The constructor '%s ' could not be found in '%s'"); 1941 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 119, "The constructor ' %s' could not be found in '%s'");
1980 1942
1981 /** 1943 /**
1982 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1944 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1983 * <i>k'</i> is not a constant constructor. 1945 * <i>k'</i> is not a constant constructor.
1984 */ 1946 */
1985 static final CompileTimeErrorCode REDIRECT_TO_NON_CLASS = new CompileTimeError Code.con1('REDIRECT_TO_NON_CLASS', 120, "The name '%s' is not a type and cannot be used in a redirected constructor"); 1947 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1('REDIRECT_TO_NON_CLASS', 120, "The name '%s' is not a type and canno t be used in a redirected constructor");
1986 1948
1987 /** 1949 /**
1988 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1950 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1989 * <i>k'</i> is not a constant constructor. 1951 * <i>k'</i> is not a constant constructor.
1990 */ 1952 */
1991 static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new Comp ileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 121, "Constant factor y constructor cannot delegate to a non-constant constructor"); 1953 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 121, "Constant fact ory constructor cannot delegate to a non-constant constructor");
1992 1954
1993 /** 1955 /**
1994 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after 1956 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after
1995 * its initializer, if any, is complete, or a compile-time error occurs. 1957 * its initializer, if any, is complete, or a compile-time error occurs.
1996 */ 1958 */
1997 static final CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = new CompileT imeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 122, "Local variables cannot be referenced before they are declared"); 1959 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 122, "Local variables canno t be referenced before they are declared");
1998 1960
1999 /** 1961 /**
2000 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not 1962 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not
2001 * enclosed within a on-catch clause. 1963 * enclosed within a on-catch clause.
2002 */ 1964 */
2003 static final CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = new CompileTimeError Code.con1('RETHROW_OUTSIDE_CATCH', 123, "rethrow must be inside of a catch claus e"); 1965 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 123, "rethrow must be inside of a catch cla use");
2004 1966
2005 /** 1967 /**
2006 * 13.11 Return: It is a compile-time error if a return statement of the form <i>return e;</i> 1968 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
2007 * appears in a generative constructor. 1969 * appears in a generative constructor.
2008 */ 1970 */
2009 static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new Compi leTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 124, "Constructors cann ot return a value"); 1971 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 124, "Constructors ca nnot return a value");
2010 1972
2011 /** 1973 /**
2012 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 1974 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
2013 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 1975 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip;
2014 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation 1976 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation
2015 * occurs in a top-level function or variable initializer, in an instance vari able initializer or 1977 * occurs in a top-level function or variable initializer, in an instance vari able initializer or
2016 * initializer list, in class Object, in a factory constructor, or in a static method or variable 1978 * initializer list, in class Object, in a factory constructor, or in a static method or variable
2017 * initializer. 1979 * initializer.
2018 */ 1980 */
2019 static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeEr rorCode.con1('SUPER_IN_INVALID_CONTEXT', 125, "Invalid context for 'super' invoc ation"); 1981 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 125, "Invalid context for 'super' inv ocation");
2020 1982
2021 /** 1983 /**
2022 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1984 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
2023 * only action is to invoke another generative constructor. 1985 * only action is to invoke another generative constructor.
2024 */ 1986 */
2025 static final CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = new Compi leTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 126, "The redirecting c onstructor cannot have a 'super' initializer"); 1987 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 126, "The redirecting constructor cannot have a 'super' initializer");
2026 1988
2027 /** 1989 /**
2028 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1990 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
2029 * error if a generative constructor of class Object includes a superinitializ er. 1991 * error if a generative constructor of class Object includes a superinitializ er.
2030 */ 1992 */
2031 static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTim eErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 127, ""); 1993 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 127, "");
2032 1994
2033 /** 1995 /**
2034 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a 1996 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a
2035 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object 1997 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object
2036 * expression are not subtypes of the bounds of the corresponding formal type parameters of 1998 * expression are not subtypes of the bounds of the corresponding formal type parameters of
2037 * <i>G</i>. 1999 * <i>G</i>.
2038 * 2000 *
2039 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a 2001 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a
2040 * dynamic error occurs. 2002 * dynamic error occurs.
2041 * 2003 *
2042 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise 2004 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
2043 * an exception. 2005 * an exception.
2044 * 2006 *
2045 * @param boundedTypeName the name of the type used in the instance creation t hat should be 2007 * @param boundedTypeName the name of the type used in the instance creation t hat should be
2046 * limited by the bound as specified in the class declaration 2008 * limited by the bound as specified in the class declaration
2047 * @param boundingTypeName the name of the bounding type 2009 * @param boundingTypeName the name of the bounding type
2048 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS 2010 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
2049 */ 2011 */
2050 static final CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Comp ileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 128, "'%s' does not e xtend '%s'"); 2012 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 128, "'%s' does not extend '%s'");
2051 2013
2052 /** 2014 /**
2053 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a 2015 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a
2054 * compile time error. 2016 * compile time error.
2055 */ 2017 */
2056 static final CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = new Com pileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 129, "Type alias ca nnot reference itself directly or recursively via another typedef"); 2018 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 129, "Type alias cannot reference itself directly or recursively via another typedef");
2057 2019
2058 /** 2020 /**
2059 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 2021 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current
2060 * scope, optionally followed by type arguments. 2022 * scope, optionally followed by type arguments.
2061 */ 2023 */
2062 static final CompileTimeErrorCode UNDEFINED_CLASS = new CompileTimeErrorCode.c on1('UNDEFINED_CLASS', 130, "Undefined class '%s'"); 2024 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 130, "Undefined class '%s'");
2063 2025
2064 /** 2026 /**
2065 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 2027 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
2066 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 2028 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
2067 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 2029 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
2068 * (respectively <i>S.id</i>) 2030 * (respectively <i>S.id</i>)
2069 */ 2031 */
2070 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new C ompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 131, "The class '%s' does not have a generative constructor '%s'"); 2032 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 131, "The cla ss '%s' does not have a generative constructor '%s'");
2071 2033
2072 /** 2034 /**
2073 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 2035 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
2074 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 2036 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
2075 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 2037 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
2076 * (respectively <i>S.id</i>) 2038 * (respectively <i>S.id</i>)
2077 */ 2039 */
2078 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = new CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 132, "The class '%s' does not have a default generative constructor"); 2040 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ', 132, "The class '%s' does not have a default generative constructor");
2079 2041
2080 /** 2042 /**
2081 * 12.14.3 Unqualified Invocation: If there exists a lexically visible declara tion named 2043 * 12.14.3 Unqualified Invocation: If there exists a lexically visible declara tion named
2082 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The n: [skip]. 2044 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The n: [skip].
2083 * Otherwise, <i>i</i> is equivalent to <b>this</b>.<i>id</i>(<i>a<sub>1</sub> </i>; ... 2045 * Otherwise, <i>i</i> is equivalent to <b>this</b>.<i>id</i>(<i>a<sub>1</sub> </i>; ...
2084 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>). 2046 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>).
2085 * 2047 *
2086 * @param methodName the name of the method that is undefined 2048 * @param methodName the name of the method that is undefined
2087 */ 2049 */
2088 static final CompileTimeErrorCode UNDEFINED_FUNCTION = new CompileTimeErrorCod e.con1('UNDEFINED_FUNCTION', 133, "The function '%s' is not defined"); 2050 static const CompileTimeErrorCode UNDEFINED_FUNCTION = const CompileTimeErrorC ode.con1('UNDEFINED_FUNCTION', 133, "The function '%s' is not defined");
2089 2051
2090 /** 2052 /**
2091 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, 2053 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
2092 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... 2054 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ...
2093 * <i>p<sub>n+k</sub></i>} or a static warning occurs. 2055 * <i>p<sub>n+k</sub></i>} or a static warning occurs.
2094 * 2056 *
2095 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 2057 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
2096 * uncaught exception being thrown. 2058 * uncaught exception being thrown.
2097 * 2059 *
2098 * @param name the name of the requested named parameter 2060 * @param name the name of the requested named parameter
2099 */ 2061 */
2100 static final CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = new CompileTimeE rrorCode.con1('UNDEFINED_NAMED_PARAMETER', 134, "The named parameter '%s' is not defined"); 2062 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 134, "The named parameter '%s' is n ot defined");
2101 2063
2102 /** 2064 /**
2103 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 2065 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
2104 * not a library declaration. 2066 * not a library declaration.
2105 * 2067 *
2106 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 2068 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
2107 * not a library declaration. 2069 * not a library declaration.
2108 * 2070 *
2109 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 2071 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
2110 * declaration. 2072 * declaration.
2111 * 2073 *
2112 * @param uri the URI pointing to a non-existent file 2074 * @param uri the URI pointing to a non-existent file
2113 * @see #INVALID_URI 2075 * @see #INVALID_URI
2114 */ 2076 */
2115 static final CompileTimeErrorCode URI_DOES_NOT_EXIST = new CompileTimeErrorCod e.con1('URI_DOES_NOT_EXIST', 135, "Target of URI does not exist: '%s'"); 2077 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 135, "Target of URI does not exist: '%s'");
2116 2078
2117 /** 2079 /**
2118 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if 2080 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
2119 * <i>x</i> involves string interpolation. 2081 * <i>x</i> involves string interpolation.
2120 * 2082 *
2121 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if 2083 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if
2122 * <i>s</i> involves string interpolation. 2084 * <i>s</i> involves string interpolation.
2123 * 2085 *
2124 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is 2086 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is
2125 * not a compile-time constant, or if <i>x</i> involves string interpolation. 2087 * not a compile-time constant, or if <i>x</i> involves string interpolation.
2126 */ 2088 */
2127 static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErro rCode.con1('URI_WITH_INTERPOLATION', 136, "URIs cannot use string interpolation" ); 2089 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 136, "URIs cannot use string interpolatio n");
2128 2090
2129 /** 2091 /**
2130 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is 2092 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is
2131 * not 2. It is a compile time error if the arity of a user-declared operator with one of the 2093 * not 2. It is a compile time error if the arity of a user-declared operator with one of the
2132 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1. 2094 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1.
2133 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a 2095 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a
2134 * compile time error if the arity of the user-declared operator ~ is not 0. 2096 * compile time error if the arity of the user-declared operator ~ is not 0.
2135 * 2097 *
2136 * @param operatorName the name of the declared operator 2098 * @param operatorName the name of the declared operator
2137 * @param expectedNumberOfParameters the number of parameters expected 2099 * @param expectedNumberOfParameters the number of parameters expected
2138 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 2100 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration
2139 */ 2101 */
2140 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = ne w CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 137, "Ope rator '%s' should declare exactly %d parameter(s), but %d found"); 2102 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 137, "O perator '%s' should declare exactly %d parameter(s), but %d found");
2141 2103
2142 /** 2104 /**
2143 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not 2105 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not
2144 * 0 or 1. 2106 * 0 or 1.
2145 * 2107 *
2146 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 2108 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration
2147 */ 2109 */
2148 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = new CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS ', 138, "Operator '-' should declare 0 or 1 parameter, but %d found"); 2110 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US', 138, "Operator '-' should declare 0 or 1 parameter, but %d found");
2149 2111
2150 /** 2112 /**
2151 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include 2113 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include
2152 * exactly one required formal parameter <i>p</i>. 2114 * exactly one required formal parameter <i>p</i>.
2153 */ 2115 */
2154 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 139, "Setters should declare exactly one required parameter"); 2116 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 139, "Sette rs should declare exactly one required parameter");
2155 2117
2156 static final List<CompileTimeErrorCode> values = [ 2118 static const List<CompileTimeErrorCode> values = const [
2157 AMBIGUOUS_EXPORT, 2119 AMBIGUOUS_EXPORT,
2158 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, 2120 ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
2159 BUILT_IN_IDENTIFIER_AS_TYPE, 2121 BUILT_IN_IDENTIFIER_AS_TYPE,
2160 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 2122 BUILT_IN_IDENTIFIER_AS_TYPE_NAME,
2161 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 2123 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME,
2162 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, 2124 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
2163 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, 2125 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
2164 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, 2126 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION,
2165 CONFLICTING_GETTER_AND_METHOD, 2127 CONFLICTING_GETTER_AND_METHOD,
2166 CONFLICTING_METHOD_AND_GETTER, 2128 CONFLICTING_METHOD_AND_GETTER,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 UNDEFINED_NAMED_PARAMETER, 2253 UNDEFINED_NAMED_PARAMETER,
2292 URI_DOES_NOT_EXIST, 2254 URI_DOES_NOT_EXIST,
2293 URI_WITH_INTERPOLATION, 2255 URI_WITH_INTERPOLATION,
2294 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, 2256 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
2295 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, 2257 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
2296 WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]; 2258 WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER];
2297 2259
2298 /** 2260 /**
2299 * The template used to create the message to be displayed for this error. 2261 * The template used to create the message to be displayed for this error.
2300 */ 2262 */
2301 String message; 2263 final String message;
2302 2264
2303 /** 2265 /**
2304 * The template used to create the correction to be displayed for this error, or `null` if 2266 * The template used to create the correction to be displayed for this error, or `null` if
2305 * there is no correction information for this error. 2267 * there is no correction information for this error.
2306 */ 2268 */
2307 String correction2; 2269 final String correction;
2308 2270
2309 /** 2271 /**
2310 * Initialize a newly created error code to have the given message. 2272 * Initialize a newly created error code to have the given message.
2311 * 2273 *
2312 * @param message the message template used to create the message to be displa yed for the error 2274 * @param message the message template used to create the message to be displa yed for the error
2313 */ 2275 */
2314 CompileTimeErrorCode.con1(String name, int ordinal, String message) : super(na me, ordinal) { 2276 const CompileTimeErrorCode.con1(String name, int ordinal, String message) : th is.con2(name, ordinal, message, null);
2315 this.message = message;
2316 }
2317 2277
2318 /** 2278 /**
2319 * Initialize a newly created error code to have the given message and correct ion. 2279 * Initialize a newly created error code to have the given message and correct ion.
2320 * 2280 *
2321 * @param message the template used to create the message to be displayed for the error 2281 * @param message the template used to create the message to be displayed for the error
2322 * @param correction the template used to create the correction to be displaye d for the error 2282 * @param correction the template used to create the correction to be displaye d for the error
2323 */ 2283 */
2324 CompileTimeErrorCode.con2(String name, int ordinal, String message, String cor rection) : super(name, ordinal) { 2284 const CompileTimeErrorCode.con2(String name, int ordinal, this.message, this.c orrection) : super(name, ordinal);
2325 this.message = message;
2326 this.correction2 = correction;
2327 }
2328
2329 @override
2330 String get correction => correction2;
2331 2285
2332 @override 2286 @override
2333 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; 2287 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
2334 2288
2335 @override 2289 @override
2336 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; 2290 ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
2337 } 2291 }
2338 2292
2339 /** 2293 /**
2340 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin g deviations 2294 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin g deviations
2341 * from pub best practices. The convention for this class is for the name of the bad practice to 2295 * from pub best practices. The convention for this class is for the name of the bad practice to
2342 * indicate the problem that caused the suggestion to be generated and for the m essage to explain 2296 * indicate the problem that caused the suggestion to be generated and for the m essage to explain
2343 * what is wrong and, when appropriate, how the situation can be corrected. 2297 * what is wrong and, when appropriate, how the situation can be corrected.
2344 */ 2298 */
2345 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { 2299 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode {
2346 /** 2300 /**
2347 * It is a bad practice for a source file in a package "lib" directory hierarc hy to traverse 2301 * It is a bad practice for a source file in a package "lib" directory hierarc hy to traverse
2348 * outside that directory hierarchy. For example, a source file in the "lib" d irectory should not 2302 * outside that directory hierarchy. For example, a source file in the "lib" d irectory should not
2349 * contain a directive such as `import '../web/some.dart'` which references a file outside 2303 * contain a directive such as `import '../web/some.dart'` which references a file outside
2350 * the lib directory. 2304 * the lib directory.
2351 */ 2305 */
2352 static final PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = new PubSuggestionCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0 , "A file in the 'lib' directory hierarchy should not reference a file outside t hat hierarchy"); 2306 static const PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const PubSuggestionCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
2353 2307
2354 /** 2308 /**
2355 * It is a bad practice for a source file ouside a package "lib" directory hie rarchy to traverse 2309 * It is a bad practice for a source file ouside a package "lib" directory hie rarchy to traverse
2356 * into that directory hierarchy. For example, a source file in the "web" dire ctory should not 2310 * into that directory hierarchy. For example, a source file in the "web" dire ctory should not
2357 * contain a directive such as `import '../lib/some.dart'` which references a file inside 2311 * contain a directive such as `import '../lib/some.dart'` which references a file inside
2358 * the lib directory. 2312 * the lib directory.
2359 */ 2313 */
2360 static final PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = new PubSuggestionCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1 , "A file outside the 'lib' directory hierarchy should not reference a file insi de that hierarchy. Use a package: reference instead."); 2314 static const PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const PubSuggestionCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1, "A file outside the 'lib' directory hierarchy should not reference a file in side that hierarchy. Use a package: reference instead.");
2361 2315
2362 /** 2316 /**
2363 * It is a bad practice for a package import to reference anything outside the given package, or 2317 * It is a bad practice for a package import to reference anything outside the given package, or
2364 * more generally, it is bad practice for a package import to contain a "..". For example, a 2318 * more generally, it is bad practice for a package import to contain a "..". For example, a
2365 * source file should not contain a directive such as `import 'package:foo/../ some.dart'`. 2319 * source file should not contain a directive such as `import 'package:foo/../ some.dart'`.
2366 */ 2320 */
2367 static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSugges tionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not contain '..'"); 2321 static const PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const PubSugg estionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should n ot contain '..'");
2368 2322
2369 static final List<PubSuggestionCode> values = [ 2323 static const List<PubSuggestionCode> values = const [
2370 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, 2324 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
2371 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, 2325 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
2372 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; 2326 PACKAGE_IMPORT_CONTAINS_DOT_DOT];
2373 2327
2374 /** 2328 /**
2375 * The template used to create the message to be displayed for this error. 2329 * The template used to create the message to be displayed for this error.
2376 */ 2330 */
2377 String message; 2331 final String message;
2378 2332
2379 /** 2333 /**
2380 * The template used to create the correction to be displayed for this error, or `null` if 2334 * The template used to create the correction to be displayed for this error, or `null` if
2381 * there is no correction information for this error. 2335 * there is no correction information for this error.
2382 */ 2336 */
2383 String correction5; 2337 final String correction;
2384 2338
2385 /** 2339 /**
2386 * Initialize a newly created error code to have the given message. 2340 * Initialize a newly created error code to have the given message.
2387 * 2341 *
2388 * @param message the message template used to create the message to be displa yed for the error 2342 * @param message the message template used to create the message to be displa yed for the error
2389 */ 2343 */
2390 PubSuggestionCode.con1(String name, int ordinal, String message) : super(name, ordinal) { 2344 const PubSuggestionCode.con1(String name, int ordinal, String message) : this. con2(name, ordinal, message, null);
2391 this.message = message;
2392 }
2393 2345
2394 /** 2346 /**
2395 * Initialize a newly created error code to have the given message and correct ion. 2347 * Initialize a newly created error code to have the given message and correct ion.
2396 * 2348 *
2397 * @param message the template used to create the message to be displayed for the error 2349 * @param message the template used to create the message to be displayed for the error
2398 * @param correction the template used to create the correction to be displaye d for the error 2350 * @param correction the template used to create the correction to be displaye d for the error
2399 */ 2351 */
2400 PubSuggestionCode.con2(String name, int ordinal, String message, String correc tion) : super(name, ordinal) { 2352 const PubSuggestionCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal);
2401 this.message = message;
2402 this.correction5 = correction;
2403 }
2404
2405 @override
2406 String get correction => correction5;
2407 2353
2408 @override 2354 @override
2409 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity; 2355 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity;
2410 2356
2411 @override 2357 @override
2412 ErrorType get type => ErrorType.PUB_SUGGESTION; 2358 ErrorType get type => ErrorType.PUB_SUGGESTION;
2413 } 2359 }
2414 2360
2415 /** 2361 /**
2416 * The enumeration `StaticWarningCode` defines the error codes used for static w arnings. The 2362 * The enumeration `StaticWarningCode` defines the error codes used for static w arnings. The
2417 * convention for this class is for the name of the error code to indicate the p roblem that caused 2363 * convention for this class is for the name of the error code to indicate the p roblem that caused
2418 * the error to be generated and for the error message to explain what is wrong and, when 2364 * the error to be generated and for the error message to explain what is wrong and, when
2419 * appropriate, how the problem can be corrected. 2365 * appropriate, how the problem can be corrected.
2420 */ 2366 */
2421 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode { 2367 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
2422 /** 2368 /**
2423 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> is introduced 2369 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> is introduced
2424 * into the top level scope <i>L</i> by more than one import then: 2370 * into the top level scope <i>L</i> by more than one import then:
2425 * <ol> 2371 * <ol>
2426 * * A static warning occurs. 2372 * * A static warning occurs.
2427 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet hodError</i> is 2373 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet hodError</i> is
2428 * raised. 2374 * raised.
2429 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. 2375 * * If <i>N</i> is referenced as a type, it is treated as a malformed type.
2430 * </ol> 2376 * </ol>
2431 * 2377 *
2432 * @param ambiguousTypeName the name of the ambiguous type 2378 * @param ambiguousTypeName the name of the ambiguous type
2433 * @param firstLibraryName the name of the first library that the type is foun d 2379 * @param firstLibraryName the name of the first library that the type is foun d
2434 * @param secondLibraryName the name of the second library that the type is fo und 2380 * @param secondLibraryName the name of the second library that the type is fo und
2435 */ 2381 */
2436 static final StaticWarningCode AMBIGUOUS_IMPORT = new StaticWarningCode.con1(' AMBIGUOUS_IMPORT', 0, "The type '%s' is defined in the libraries '%s' and '%s'") ; 2382 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode.con1 ('AMBIGUOUS_IMPORT', 0, "The type '%s' is defined in the libraries '%s' and '%s' ");
2437 2383
2438 /** 2384 /**
2439 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+ 2385 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+
2440 * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor 2386 * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor
2441 * <i>T.id</i> (respectively <i>T</i>). 2387 * <i>T.id</i> (respectively <i>T</i>).
2442 * 2388 *
2443 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub >, 1 &lt;= i &lt;= 2389 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub >, 1 &lt;= i &lt;=
2444 * n+ k</i> may not be assigned to the type of the corresponding formal parame ter of the 2390 * n+ k</i> may not be assigned to the type of the corresponding formal parame ter of the
2445 * constructor <i>T.id</i> (respectively <i>T</i>). 2391 * constructor <i>T.id</i> (respectively <i>T</i>).
2446 * 2392 *
2447 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 2393 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
2448 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 2394 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
2449 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 2395 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
2450 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 2396 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
2451 * j &lt;= m</i>. 2397 * j &lt;= m</i>.
2452 * 2398 *
2453 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 & lt;= i &lt;= l</i>, 2399 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 & lt;= i &lt;= l</i>,
2454 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, & hellip; 2400 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, & hellip;
2455 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if 2401 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if
2456 * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where < i>r = q<sub>j</sub>, 2402 * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where < i>r = q<sub>j</sub>,
2457 * 1 &lt;= j &lt;= l</i>. 2403 * 1 &lt;= j &lt;= l</i>.
2458 * 2404 *
2459 * @param actualType the name of the actual argument type 2405 * @param actualType the name of the actual argument type
2460 * @param expectedType the name of the expected type 2406 * @param expectedType the name of the expected type
2461 */ 2407 */
2462 static final StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new StaticWarnin gCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot be assigned to the parameter type '%s'"); 2408 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarn ingCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot b e assigned to the parameter type '%s'");
2463 2409
2464 /** 2410 /**
2465 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError 2411 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
2466 * to be thrown, because no setter is defined for it. The assignment will also give rise to a 2412 * to be thrown, because no setter is defined for it. The assignment will also give rise to a
2467 * static warning for the same reason. 2413 * static warning for the same reason.
2468 * 2414 *
2469 * A constant variable is always implicitly final. 2415 * A constant variable is always implicitly final.
2470 */ 2416 */
2471 static final StaticWarningCode ASSIGNMENT_TO_CONST = new StaticWarningCode.con 1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value"); 2417 static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode.c on1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value");
2472 2418
2473 /** 2419 /**
2474 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError 2420 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
2475 * to be thrown, because no setter is defined for it. The assignment will also give rise to a 2421 * to be thrown, because no setter is defined for it. The assignment will also give rise to a
2476 * static warning for the same reason. 2422 * static warning for the same reason.
2477 */ 2423 */
2478 static final StaticWarningCode ASSIGNMENT_TO_FINAL = new StaticWarningCode.con 1('ASSIGNMENT_TO_FINAL', 3, "'%s' cannot be used as a setter, it is final"); 2424 static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode.c on1('ASSIGNMENT_TO_FINAL', 3, "'%s' cannot be used as a setter, it is final");
2479 2425
2480 /** 2426 /**
2481 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 2427 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
2482 * warning if <i>T</i> does not have an accessible instance setter named <i>v =</i>. 2428 * warning if <i>T</i> does not have an accessible instance setter named <i>v =</i>.
2483 */ 2429 */
2484 static final StaticWarningCode ASSIGNMENT_TO_METHOD = new StaticWarningCode.co n1('ASSIGNMENT_TO_METHOD', 4, "Methods cannot be assigned a value"); 2430 static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode. con1('ASSIGNMENT_TO_METHOD', 4, "Methods cannot be assigned a value");
2485 2431
2486 /** 2432 /**
2487 * 13.9 Switch: It is a static warning if the last statement of the statement sequence 2433 * 13.9 Switch: It is a static warning if the last statement of the statement sequence
2488 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. 2434 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement.
2489 */ 2435 */
2490 static final StaticWarningCode CASE_BLOCK_NOT_TERMINATED = new StaticWarningCo de.con1('CASE_BLOCK_NOT_TERMINATED', 5, "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'"); 2436 static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarning Code.con1('CASE_BLOCK_NOT_TERMINATED', 5, "The last statement of the 'case' shou ld be 'break', 'continue', 'return' or 'throw'");
2491 2437
2492 /** 2438 /**
2493 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the 2439 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the
2494 * current lexical scope. 2440 * current lexical scope.
2495 */ 2441 */
2496 static final StaticWarningCode CAST_TO_NON_TYPE = new StaticWarningCode.con1(' CAST_TO_NON_TYPE', 6, "The name '%s' is not a type and cannot be used in an 'as' expression"); 2442 static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode.con1 ('CAST_TO_NON_TYPE', 6, "The name '%s' is not a type and cannot be used in an 'a s' expression");
2497 2443
2498 /** 2444 /**
2499 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 2445 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
2500 * inherited in a concrete class. 2446 * inherited in a concrete class.
2501 */ 2447 */
2502 static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new Stati cWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 7, "'%s' must have a me thod body because '%s' is not abstract"); 2448 static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const Sta ticWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 7, "'%s' must have a method body because '%s' is not abstract");
2503 2449
2504 /** 2450 /**
2505 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> would be 2451 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> would be
2506 * introduced into the top level scope of <i>L</i> by an import from a library whose URI begins 2452 * introduced into the top level scope of <i>L</i> by an import from a library whose URI begins
2507 * with <i>dart:</i> and an import from a library whose URI does not begin wit h <i>dart:</i>: 2453 * with <i>dart:</i> and an import from a library whose URI does not begin wit h <i>dart:</i>:
2508 * * The import from <i>dart:</i> is implicitly extended by a hide N clause. 2454 * * The import from <i>dart:</i> is implicitly extended by a hide N clause.
2509 * * A static warning is issued. 2455 * * A static warning is issued.
2510 * 2456 *
2511 * @param ambiguousName the ambiguous name 2457 * @param ambiguousName the ambiguous name
2512 * @param sdkLibraryName the name of the dart: library that the element is fou nd 2458 * @param sdkLibraryName the name of the dart: library that the element is fou nd
2513 * @param otherLibraryName the name of the non-dart: library that the element is found 2459 * @param otherLibraryName the name of the non-dart: library that the element is found
2514 */ 2460 */
2515 static final StaticWarningCode CONFLICTING_DART_IMPORT = new StaticWarningCode .con1('CONFLICTING_DART_IMPORT', 8, "Element '%s' from SDK library '%s' is impli citly hidden by '%s'"); 2461 static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCo de.con1('CONFLICTING_DART_IMPORT', 8, "Element '%s' from SDK library '%s' is imp licitly hidden by '%s'");
2516 2462
2517 /** 2463 /**
2518 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc e getter named 2464 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc e getter named
2519 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec lared in a 2465 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec lared in a
2520 * superclass of <i>C</i>. 2466 * superclass of <i>C</i>.
2521 * 2467 *
2522 * @param superName the name of the super class declaring a static member 2468 * @param superName the name of the super class declaring a static member
2523 */ 2469 */
2524 static final StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER', 9, "Superclass '%s' declares static member with the same name"); 2470 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_ME MBER', 9, "Superclass '%s' declares static member with the same name");
2525 2471
2526 /** 2472 /**
2527 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method 2473 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method
2528 * named <i>n</i> and has a setter named <i>n=</i>. 2474 * named <i>n</i> and has a setter named <i>n=</i>.
2529 */ 2475 */
2530 static final StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = new Static WarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 10, "Class '%s' declares instance method '%s', but also has a setter with the same name from '%s'"); 2476 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const Stat icWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 10, "Class '%s' declare s instance method '%s', but also has a setter with the same name from '%s'");
2531 2477
2532 /** 2478 /**
2533 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method 2479 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method
2534 * named <i>n</i> and has a setter named <i>n=</i>. 2480 * named <i>n</i> and has a setter named <i>n=</i>.
2535 */ 2481 */
2536 static final StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = new Stati cWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 11, "Class '%s' declare s the setter '%s', but also has an instance method in the same class"); 2482 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const Sta ticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 11, "Class '%s' decla res the setter '%s', but also has an instance method in the same class");
2537 2483
2538 /** 2484 /**
2539 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc e setter named 2485 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc e setter named
2540 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de clared in a 2486 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de clared in a
2541 * superclass of <i>C</i>. 2487 * superclass of <i>C</i>.
2542 * 2488 *
2543 * @param superName the name of the super class declaring a static member 2489 * @param superName the name of the super class declaring a static member
2544 */ 2490 */
2545 static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER', 12, "Superclass '%s' declares static member with the same name"); 2491 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_ME MBER', 12, "Superclass '%s' declares static member with the same name");
2546 2492
2547 /** 2493 /**
2548 * 7.2 Getters: It is a static warning if a class declares a static getter nam ed <i>v</i> and also 2494 * 7.2 Getters: It is a static warning if a class declares a static getter nam ed <i>v</i> and also
2549 * has a non-static setter named <i>v=</i>. 2495 * has a non-static setter named <i>v=</i>.
2550 */ 2496 */
2551 static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = new StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 13, "Class '%s' declares non-static setter with the same name"); 2497 static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 1 3, "Class '%s' declares non-static setter with the same name");
2552 2498
2553 /** 2499 /**
2554 * 7.3 Setters: It is a static warning if a class declares a static setter nam ed <i>v=</i> and 2500 * 7.3 Setters: It is a static warning if a class declares a static setter nam ed <i>v=</i> and
2555 * also has a non-static member named <i>v</i>. 2501 * also has a non-static member named <i>v</i>.
2556 */ 2502 */
2557 static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = new StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 14, "Class '%s' declares non-static member with the same name"); 2503 static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 1 4, "Class '%s' declares non-static member with the same name");
2558 2504
2559 /** 2505 /**
2560 * 12.11.2 Const: Given an instance creation expression of the form <i>const q (a<sub>1</sub>, 2506 * 12.11.2 Const: Given an instance creation expression of the form <i>const q (a<sub>1</sub>,
2561 * &hellip; a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const ructor of an 2507 * &hellip; a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const ructor of an
2562 * abstract class but <i>q</i> is not a factory constructor. 2508 * abstract class but <i>q</i> is not a factory constructor.
2563 */ 2509 */
2564 static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCo de.con1('CONST_WITH_ABSTRACT_CLASS', 15, "Abstract classes cannot be created wit h a 'const' expression"); 2510 static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarning Code.con1('CONST_WITH_ABSTRACT_CLASS', 15, "Abstract classes cannot be created w ith a 'const' expression");
2565 2511
2566 /** 2512 /**
2567 * 12.7 Maps: It is a static warning if the values of any two keys in a map li teral are equal. 2513 * 12.7 Maps: It is a static warning if the values of any two keys in a map li teral are equal.
2568 */ 2514 */
2569 static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode.con1( 'EQUAL_KEYS_IN_MAP', 16, "Keys in a map cannot be equal"); 2515 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode.con 1('EQUAL_KEYS_IN_MAP', 16, "Keys in a map cannot be equal");
2570 2516
2571 /** 2517 /**
2572 * 14.2 Exports: It is a static warning to export two different libraries with the same name. 2518 * 14.2 Exports: It is a static warning to export two different libraries with the same name.
2573 * 2519 *
2574 * @param uri1 the uri pointing to a first library 2520 * @param uri1 the uri pointing to a first library
2575 * @param uri2 the uri pointing to a second library 2521 * @param uri2 the uri pointing to a second library
2576 * @param name the shared name of the exported libraries 2522 * @param name the shared name of the exported libraries
2577 */ 2523 */
2578 static final StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn ingCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 17, "The exported libraries '%s' and '%s' should not have the same name '%s'"); 2524 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 17, "The exported libraries '%s ' and '%s' should not have the same name '%s'");
2579 2525
2580 /** 2526 /**
2581 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 2527 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt;
2582 * n</i>. 2528 * n</i>.
2583 * 2529 *
2584 * @param requiredCount the maximum number of positional arguments 2530 * @param requiredCount the maximum number of positional arguments
2585 * @param argumentCount the actual number of positional arguments given 2531 * @param argumentCount the actual number of positional arguments given
2586 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS 2532 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS
2587 */ 2533 */
2588 static final StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = new StaticWarningC ode.con1('EXTRA_POSITIONAL_ARGUMENTS', 18, "%d positional arguments expected, bu t %d found"); 2534 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin gCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 18, "%d positional arguments expected, but %d found");
2589 2535
2590 /** 2536 /**
2591 * 5. Variables: It is a static warning if a final instance variable that has been initialized at 2537 * 5. Variables: It is a static warning if a final instance variable that has been initialized at
2592 * its point of declaration is also initialized in a constructor. 2538 * its point of declaration is also initialized in a constructor.
2593 */ 2539 */
2594 static final StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = new StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION ', 19, "Values cannot be set in the constructor if they are final, and have alre ady been set"); 2540 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = const StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATI ON', 19, "Values cannot be set in the constructor if they are final, and have al ready been set");
2595 2541
2596 /** 2542 /**
2597 * 5. Variables: It is a static warning if a final instance variable that has been initialized at 2543 * 5. Variables: It is a static warning if a final instance variable that has been initialized at
2598 * its point of declaration is also initialized in a constructor. 2544 * its point of declaration is also initialized in a constructor.
2599 * 2545 *
2600 * @param name the name of the field in question 2546 * @param name the name of the field in question
2601 */ 2547 */
2602 static final StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = new StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR ', 20, "'%s' is final and was given a value when it was declared, so it cannot b e set to a new value"); 2548 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = const StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCT OR', 20, "'%s' is final and was given a value when it was declared, so it cannot be set to a new value");
2603 2549
2604 /** 2550 /**
2605 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t his</b>.<i>v</i> = 2551 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t his</b>.<i>v</i> =
2606 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t o an object 2552 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t o an object
2607 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi s is bound to 2553 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi s is bound to
2608 * <i>o</i>. 2554 * <i>o</i>.
2609 * 2555 *
2610 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 2556 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
2611 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 2557 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
2612 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 2558 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
2613 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 2559 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
2614 * j &lt;= m</i>. 2560 * j &lt;= m</i>.
2615 * 2561 *
2616 * @param initializerType the name of the type of the initializer expression 2562 * @param initializerType the name of the type of the initializer expression
2617 * @param fieldType the name of the type of the field 2563 * @param fieldType the name of the type of the field
2618 */ 2564 */
2619 static final StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = new StaticWa rningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 21, "The initializer type '%s ' cannot be assigned to the field type '%s'"); 2565 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const Static WarningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 21, "The initializer type ' %s' cannot be assigned to the field type '%s'");
2620 2566
2621 /** 2567 /**
2622 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 2568 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a
2623 * static warning if the static type of <i>id</i> is not assignable to <i>T<su b>id</sub></i>. 2569 * static warning if the static type of <i>id</i> is not assignable to <i>T<su b>id</sub></i>.
2624 * 2570 *
2625 * @param parameterType the name of the type of the field formal parameter 2571 * @param parameterType the name of the type of the field formal parameter
2626 * @param fieldType the name of the type of the field 2572 * @param fieldType the name of the type of the field
2627 */ 2573 */
2628 static final StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = new StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 22, "The para meter type '%s' is incompatable with the field type '%s'"); 2574 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = cons t StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 22, "The pa rameter type '%s' is incompatable with the field type '%s'");
2629 2575
2630 /** 2576 /**
2631 * 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final 2577 * 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final
2632 * and <i>v</i> is not initialized at its point of declaration. 2578 * and <i>v</i> is not initialized at its point of declaration.
2633 * 2579 *
2634 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar ed in the 2580 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar ed in the
2635 * immediately enclosing class must have an initializer in <i>k</i>'s initiali zer list unless it 2581 * immediately enclosing class must have an initializer in <i>k</i>'s initiali zer list unless it
2636 * has already been initialized by one of the following means: 2582 * has already been initialized by one of the following means:
2637 * * Initialization at the declaration of <i>f</i>. 2583 * * Initialization at the declaration of <i>f</i>.
2638 * * Initialization by means of an initializing formal of <i>k</i>. 2584 * * Initialization by means of an initializing formal of <i>k</i>.
2639 * or a static warning occurs. 2585 * or a static warning occurs.
2640 * 2586 *
2641 * @param name the name of the uninitialized final variable 2587 * @param name the name of the uninitialized final variable
2642 */ 2588 */
2643 static final StaticWarningCode FINAL_NOT_INITIALIZED = new StaticWarningCode.c on1('FINAL_NOT_INITIALIZED', 23, "The final variable '%s' must be initialized"); 2589 static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode .con1('FINAL_NOT_INITIALIZED', 23, "The final variable '%s' must be initialized" );
2644 2590
2645 /** 2591 /**
2646 * 15.5 Function Types: It is a static warning if a concrete class implements Function and does 2592 * 15.5 Function Types: It is a static warning if a concrete class implements Function and does
2647 * not have a concrete method named call(). 2593 * not have a concrete method named call().
2648 */ 2594 */
2649 static final StaticWarningCode FUNCTION_WITHOUT_CALL = new StaticWarningCode.c on1('FUNCTION_WITHOUT_CALL', 24, "Concrete classes that implement Function must implement the method call()"); 2595 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode .con1('FUNCTION_WITHOUT_CALL', 24, "Concrete classes that implement Function mus t implement the method call()");
2650 2596
2651 /** 2597 /**
2652 * 14.1 Imports: It is a static warning to import two different libraries with the same name. 2598 * 14.1 Imports: It is a static warning to import two different libraries with the same name.
2653 * 2599 *
2654 * @param uri1 the uri pointing to a first library 2600 * @param uri1 the uri pointing to a first library
2655 * @param uri2 the uri pointing to a second library 2601 * @param uri2 the uri pointing to a second library
2656 * @param name the shared name of the imported libraries 2602 * @param name the shared name of the imported libraries
2657 */ 2603 */
2658 static final StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn ingCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 25, "The imported libraries '%s' and '%s' should not have the same name '%s'"); 2604 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 25, "The imported libraries '%s ' and '%s' should not have the same name '%s'");
2659 2605
2660 /** 2606 /**
2661 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i >m<sub>1</sub>, 2607 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i >m<sub>1</sub>,
2662 * &hellip; m<sub>k</sub></i> with the same name <i>n</i> that would be inheri ted (because 2608 * &hellip; m<sub>k</sub></i> with the same name <i>n</i> that would be inheri ted (because
2663 * identically named members existed in several superinterfaces) then at most one member is 2609 * identically named members existed in several superinterfaces) then at most one member is
2664 * inherited. 2610 * inherited.
2665 * 2611 *
2666 * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i>, are get ters, or if some but 2612 * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i>, are get ters, or if some but
2667 * not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</su b></i> are 2613 * not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</su b></i> are
2668 * inherited, and a static warning is issued. 2614 * inherited, and a static warning is issued.
2669 */ 2615 */
2670 static final StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = new StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD', 26, "'%s' is inherited as a getter and also a method"); 2616 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = const StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_ME THOD', 26, "'%s' is inherited as a getter and also a method");
2671 2617
2672 /** 2618 /**
2673 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method 2619 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method
2674 * named <i>n</i> and an accessible static member named <i>n</i> is declared i n a superclass of 2620 * named <i>n</i> and an accessible static member named <i>n</i> is declared i n a superclass of
2675 * <i>C</i>. 2621 * <i>C</i>.
2676 * 2622 *
2677 * @param memberName the name of the member with the name conflict 2623 * @param memberName the name of the member with the name conflict
2678 * @param superclassName the name of the enclosing class that has the static m ember 2624 * @param superclassName the name of the enclosing class that has the static m ember
2679 */ 2625 */
2680 static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = new StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLAS S_STATIC', 27, "'%s' collides with a static member in the superclass '%s'"); 2626 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = const StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCL ASS_STATIC', 27, "'%s' collides with a static member in the superclass '%s'");
2681 2627
2682 /** 2628 /**
2683 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette r <i>m2</i> and the 2629 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette r <i>m2</i> and the
2684 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 2630 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
2685 * 2631 *
2686 * @param actualReturnTypeName the name of the expected return type 2632 * @param actualReturnTypeName the name of the expected return type
2687 * @param expectedReturnType the name of the actual return type, not assignabl e to the 2633 * @param expectedReturnType the name of the actual return type, not assignabl e to the
2688 * actualReturnTypeName 2634 * actualReturnTypeName
2689 * @param className the name of the class where the overridden getter is decla red 2635 * @param className the name of the class where the overridden getter is decla red
2690 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE 2636 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE
2691 */ 2637 */
2692 static final StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = new Stati cWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 28, "The return type '% s' is not assignable to '%s' as required by the getter it is overriding from '%s '"); 2638 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 28, "The return type '%s' is not assignable to '%s' as required by the getter it is overriding from ' %s'");
2693 2639
2694 /** 2640 /**
2695 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2641 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2696 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 2642 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
2697 * 2643 *
2698 * @param actualParamTypeName the name of the expected parameter type 2644 * @param actualParamTypeName the name of the expected parameter type
2699 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 2645 * @param expectedParamType the name of the actual parameter type, not assigna ble to the
2700 * actualParamTypeName 2646 * actualParamTypeName
2701 * @param className the name of the class where the overridden method is decla red 2647 * @param className the name of the class where the overridden method is decla red
2702 */ 2648 */
2703 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = new StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 29, "The para meter type '%s' is not assignable to '%s' as required by the method it is overri ding from '%s'"); 2649 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons t StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 29, "The pa rameter type '%s' is not assignable to '%s' as required by the method it is over riding from '%s'");
2704 2650
2705 /** 2651 /**
2706 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2652 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2707 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 2653 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
2708 * 2654 *
2709 * @param actualParamTypeName the name of the expected parameter type 2655 * @param actualParamTypeName the name of the expected parameter type
2710 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 2656 * @param expectedParamType the name of the actual parameter type, not assigna ble to the
2711 * actualParamTypeName 2657 * actualParamTypeName
2712 * @param className the name of the class where the overridden method is decla red 2658 * @param className the name of the class where the overridden method is decla red
2713 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE 2659 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE
2714 */ 2660 */
2715 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = new StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 30, "The pa rameter type '%s' is not assignable to '%s' as required by the method it is over riding from '%s'"); 2661 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 30, "The parameter type '%s' is not assignable to '%s' as required by the method it is ov erriding from '%s'");
2716 2662
2717 /** 2663 /**
2718 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2664 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2719 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 2665 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
2720 * 2666 *
2721 * @param actualParamTypeName the name of the expected parameter type 2667 * @param actualParamTypeName the name of the expected parameter type
2722 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 2668 * @param expectedParamType the name of the actual parameter type, not assigna ble to the
2723 * actualParamTypeName 2669 * actualParamTypeName
2724 * @param className the name of the class where the overridden method is decla red 2670 * @param className the name of the class where the overridden method is decla red
2725 */ 2671 */
2726 static final StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = n ew StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 31, "Th e parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'"); 2672 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c onst StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 31, " The parameter type '%s' is not assignable to '%s' as required by the method it i s overriding from '%s'");
2727 2673
2728 /** 2674 /**
2729 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2675 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2730 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 2676 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
2731 * 2677 *
2732 * @param actualReturnTypeName the name of the expected return type 2678 * @param actualReturnTypeName the name of the expected return type
2733 * @param expectedReturnType the name of the actual return type, not assignabl e to the 2679 * @param expectedReturnType the name of the actual return type, not assignabl e to the
2734 * actualReturnTypeName 2680 * actualReturnTypeName
2735 * @param className the name of the class where the overridden method is decla red 2681 * @param className the name of the class where the overridden method is decla red
2736 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE 2682 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE
2737 */ 2683 */
2738 static final StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = new Stati cWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 32, "The return type '% s' is not assignable to '%s' as required by the method it is overriding from '%s '"); 2684 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 32, "The return type '%s' is not assignable to '%s' as required by the method it is overriding from ' %s'");
2739 2685
2740 /** 2686 /**
2741 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2687 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2742 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for 2688 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for
2743 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value 2689 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value
2744 * for <i>p</i>. 2690 * for <i>p</i>.
2745 */ 2691 */
2746 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', 33, "Parameters cannot override default values, this method overrides '%s.%s' w here '%s' has a different value"); 2692 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED ', 33, "Parameters cannot override default values, this method overrides '%s.%s' where '%s' has a different value");
2747 2693
2748 /** 2694 /**
2749 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2695 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2750 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for 2696 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for
2751 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value 2697 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value
2752 * for <i>p</i>. 2698 * for <i>p</i>.
2753 */ 2699 */
2754 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_PO SITIONAL', 34, "Parameters cannot override default values, this method overrides '%s.%s' where this positional parameter has a different value"); 2700 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_ POSITIONAL', 34, "Parameters cannot override default values, this method overrid es '%s.%s' where this positional parameter has a different value");
2755 2701
2756 /** 2702 /**
2757 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2703 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2758 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para meters declared by 2704 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para meters declared by
2759 * <i>m2</i>. 2705 * <i>m2</i>.
2760 * 2706 *
2761 * @param paramCount the number of named parameters in the overridden member 2707 * @param paramCount the number of named parameters in the overridden member
2762 * @param className the name of the class from the overridden method 2708 * @param className the name of the class from the overridden method
2763 */ 2709 */
2764 static final StaticWarningCode INVALID_OVERRIDE_NAMED = new StaticWarningCode. con1('INVALID_OVERRIDE_NAMED', 35, "Missing the named parameter '%s' to match th e overridden method from '%s'"); 2710 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e.con1('INVALID_OVERRIDE_NAMED', 35, "Missing the named parameter '%s' to match the overridden method from '%s'");
2765 2711
2766 /** 2712 /**
2767 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2713 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2768 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha n <i>m2</i>. 2714 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha n <i>m2</i>.
2769 * 2715 *
2770 * @param paramCount the number of positional parameters in the overridden mem ber 2716 * @param paramCount the number of positional parameters in the overridden mem ber
2771 * @param className the name of the class from the overridden method 2717 * @param className the name of the class from the overridden method
2772 */ 2718 */
2773 static final StaticWarningCode INVALID_OVERRIDE_POSITIONAL = new StaticWarning Code.con1('INVALID_OVERRIDE_POSITIONAL', 36, "Must have at least %d parameters t o match the overridden method from '%s'"); 2719 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarni ngCode.con1('INVALID_OVERRIDE_POSITIONAL', 36, "Must have at least %d parameters to match the overridden method from '%s'");
2774 2720
2775 /** 2721 /**
2776 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 2722 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an
2777 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa rameters than 2723 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa rameters than
2778 * <i>m2</i>. 2724 * <i>m2</i>.
2779 * 2725 *
2780 * @param paramCount the number of required parameters in the overridden membe r 2726 * @param paramCount the number of required parameters in the overridden membe r
2781 * @param className the name of the class from the overridden method 2727 * @param className the name of the class from the overridden method
2782 */ 2728 */
2783 static final StaticWarningCode INVALID_OVERRIDE_REQUIRED = new StaticWarningCo de.con1('INVALID_OVERRIDE_REQUIRED', 37, "Must have %d required parameters or le ss to match the overridden method from '%s'"); 2729 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarning Code.con1('INVALID_OVERRIDE_REQUIRED', 37, "Must have %d required parameters or less to match the overridden method from '%s'");
2784 2730
2785 /** 2731 /**
2786 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette r <i>m2</i> and the 2732 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette r <i>m2</i> and the
2787 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 2733 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
2788 * 2734 *
2789 * @param actualParamTypeName the name of the expected parameter type 2735 * @param actualParamTypeName the name of the expected parameter type
2790 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 2736 * @param expectedParamType the name of the actual parameter type, not assigna ble to the
2791 * actualParamTypeName 2737 * actualParamTypeName
2792 * @param className the name of the class where the overridden setter is decla red 2738 * @param className the name of the class where the overridden setter is decla red
2793 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE 2739 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
2794 */ 2740 */
2795 static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 38, "The pa rameter type '%s' is not assignable to '%s' as required by the setter it is over riding from '%s'"); 2741 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 38, "The parameter type '%s' is not assignable to '%s' as required by the setter it is ov erriding from '%s'");
2796 2742
2797 /** 2743 /**
2798 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ... 2744 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
2799 * <i>e<sub>n</sub></i>] is evaluated as follows: 2745 * <i>e<sub>n</sub></i>] is evaluated as follows:
2800 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument 2746 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
2801 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i> 2747 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
2802 * 2748 *
2803 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 2749 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
2804 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 2750 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
2805 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 2751 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
2806 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 2752 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
2807 * j &lt;= m</i>. 2753 * j &lt;= m</i>.
2808 */ 2754 */
2809 static final StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new StaticWa rningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 39, "The element type '%s' ca nnot be assigned to the list type '%s'"); 2755 static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Static WarningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 39, "The element type '%s' cannot be assigned to the list type '%s'");
2810 2756
2811 /** 2757 /**
2812 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 2758 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
2813 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 2759 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
2814 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 2760 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
2815 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 2761 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
2816 * 2762 *
2817 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 2763 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
2818 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 2764 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
2819 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 2765 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
2820 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 2766 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
2821 * j &lt;= m</i>. 2767 * j &lt;= m</i>.
2822 */ 2768 */
2823 static final StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new StaticWarning Code.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' cannot be as signed to the map key type '%s'"); 2769 static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarni ngCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' cannot be assigned to the map key type '%s'");
2824 2770
2825 /** 2771 /**
2826 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 2772 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
2827 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 2773 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
2828 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 2774 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
2829 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 2775 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
2830 * 2776 *
2831 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 2777 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
2832 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 2778 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
2833 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 2779 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
2834 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 2780 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
2835 * j &lt;= m</i>. 2781 * j &lt;= m</i>.
2836 */ 2782 */
2837 static final StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new StaticWarni ngCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 41, "The element type '%s' cannot b e assigned to the map value type '%s'"); 2783 static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWar ningCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 41, "The element type '%s' cannot be assigned to the map value type '%s'");
2838 2784
2839 /** 2785 /**
2840 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type 2786 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
2841 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be 2787 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be
2842 * assigned to <i>S</i>. 2788 * assigned to <i>S</i>.
2843 */ 2789 */
2844 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new Static WarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 42, "The parameter type f or setter '%s' is '%s' which is not assignable to its getter (of type '%s')"); 2790 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const Stat icWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 42, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s')");
2845 2791
2846 /** 2792 /**
2847 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type 2793 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
2848 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be 2794 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be
2849 * assigned to <i>S</i>. 2795 * assigned to <i>S</i>.
2850 */ 2796 */
2851 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE = new StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE', 43, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s'), from superclass '%s'"); 2797 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPER TYPE', 43, "The parameter type for setter '%s' is '%s' which is not assignable t o its getter (of type '%s'), from superclass '%s'");
2852 2798
2853 /** 2799 /**
2854 * 13.12 Return: It is a static warning if a function contains both one or mor e return statements 2800 * 13.12 Return: It is a static warning if a function contains both one or mor e return statements
2855 * of the form <i>return;</i> and one or more return statements of the form <i >return e;</i>. 2801 * of the form <i>return;</i> and one or more return statements of the form <i >return e;</i>.
2856 */ 2802 */
2857 static final StaticWarningCode MIXED_RETURN_TYPES = new StaticWarningCode.con1 ('MIXED_RETURN_TYPES', 44, "Methods and functions cannot use return both with an d without values"); 2803 static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode.co n1('MIXED_RETURN_TYPES', 44, "Methods and functions cannot use return both with and without values");
2858 2804
2859 /** 2805 /**
2860 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst ract class and 2806 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst ract class and
2861 * <i>q</i> is not a factory constructor. 2807 * <i>q</i> is not a factory constructor.
2862 */ 2808 */
2863 static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode .con1('NEW_WITH_ABSTRACT_CLASS', 45, "Abstract classes cannot be created with a 'new' expression"); 2809 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo de.con1('NEW_WITH_ABSTRACT_CLASS', 45, "Abstract classes cannot be created with a 'new' expression");
2864 2810
2865 /** 2811 /**
2866 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat ic warning. 2812 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat ic warning.
2867 * 2813 *
2868 * @param typeName the name of the type being referenced (<i>S</i>) 2814 * @param typeName the name of the type being referenced (<i>S</i>)
2869 * @param parameterCount the number of type parameters that were declared 2815 * @param parameterCount the number of type parameters that were declared
2870 * @param argumentCount the number of type arguments provided 2816 * @param argumentCount the number of type arguments provided
2871 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS 2817 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS
2872 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS 2818 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
2873 */ 2819 */
2874 static final StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = new StaticWa rningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 46, "The type '%s' is declare d with %d type parameters, but %d type arguments were given"); 2820 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static WarningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 46, "The type '%s' is decla red with %d type parameters, but %d type arguments were given");
2875 2821
2876 /** 2822 /**
2877 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i n the current scope, 2823 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i n the current scope,
2878 * optionally followed by type arguments. 2824 * optionally followed by type arguments.
2879 * 2825 *
2880 * @param name the name of the non-type element 2826 * @param name the name of the non-type element
2881 */ 2827 */
2882 static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode.con1( 'NEW_WITH_NON_TYPE', 47, "The name '%s' is not a class"); 2828 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode.con 1('NEW_WITH_NON_TYPE', 47, "The name '%s' is not a class");
2883 2829
2884 /** 2830 /**
2885 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: 2831 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
2886 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n< /sub>, 2832 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n< /sub>,
2887 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a 2833 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a
2888 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. 2834 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>.
2889 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x< sub>n+1</sub>: 2835 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x< sub>n+1</sub>:
2890 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta tic warning if the 2836 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta tic warning if the
2891 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. 2837 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>.
2892 */ 2838 */
2893 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarn ingCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 48, "The class '%s' does not have a constructor '%s'"); 2839 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWa rningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 48, "The class '%s' does not ha ve a constructor '%s'");
2894 2840
2895 /** 2841 /**
2896 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: 2842 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
2897 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n< /sub>, 2843 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n< /sub>,
2898 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a 2844 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a
2899 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. 2845 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>.
2900 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x< sub>n+1</sub>: 2846 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x< sub>n+1</sub>:
2901 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta tic warning if the 2847 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta tic warning if the
2902 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. 2848 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>.
2903 */ 2849 */
2904 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new St aticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 49, "The class '% s' does not have a default constructor"); 2850 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 49, "The class '%s' does not have a default constructor");
2905 2851
2906 /** 2852 /**
2907 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 2853 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
2908 * abstract method. 2854 * abstract method.
2909 * 2855 *
2910 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 2856 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own
2911 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 2857 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i>
2912 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 2858 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
2913 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 2859 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
2914 * 2860 *
2915 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 2861 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
2916 * inherited in a concrete class unless that member overrides a concrete one. 2862 * inherited in a concrete class unless that member overrides a concrete one.
2917 * 2863 *
2918 * @param memberName the name of the first member 2864 * @param memberName the name of the first member
2919 * @param memberName the name of the second member 2865 * @param memberName the name of the second member
2920 * @param memberName the name of the third member 2866 * @param memberName the name of the third member
2921 * @param memberName the name of the fourth member 2867 * @param memberName the name of the fourth member
2922 * @param additionalCount the number of additional missing members that aren't listed 2868 * @param additionalCount the number of additional missing members that aren't listed
2923 */ 2869 */
2924 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER _FIVE_PLUS', 50, "Missing concrete implementation of '%s', '%s', '%s', '%s' and %d more"); 2870 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMB ER_FIVE_PLUS', 50, "Missing concrete implementation of %s, %s, %s, %s and %d mor e");
2925 2871
2926 /** 2872 /**
2927 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 2873 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
2928 * abstract method. 2874 * abstract method.
2929 * 2875 *
2930 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 2876 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own
2931 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 2877 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i>
2932 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 2878 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
2933 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 2879 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
2934 * 2880 *
2935 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 2881 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
2936 * inherited in a concrete class unless that member overrides a concrete one. 2882 * inherited in a concrete class unless that member overrides a concrete one.
2937 * 2883 *
2938 * @param memberName the name of the first member 2884 * @param memberName the name of the first member
2939 * @param memberName the name of the second member 2885 * @param memberName the name of the second member
2940 * @param memberName the name of the third member 2886 * @param memberName the name of the third member
2941 * @param memberName the name of the fourth member 2887 * @param memberName the name of the fourth member
2942 */ 2888 */
2943 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR ', 51, "Missing concrete implementation of '%s', '%s', '%s' and '%s'"); 2889 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FO UR', 51, "Missing concrete implementation of %s, %s, %s and %s");
2944 2890
2945 /** 2891 /**
2946 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 2892 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
2947 * abstract method. 2893 * abstract method.
2948 * 2894 *
2949 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 2895 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own
2950 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 2896 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i>
2951 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 2897 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
2952 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 2898 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
2953 * 2899 *
2954 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 2900 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
2955 * inherited in a concrete class unless that member overrides a concrete one. 2901 * inherited in a concrete class unless that member overrides a concrete one.
2956 * 2902 *
2957 * @param memberName the name of the member 2903 * @param memberName the name of the member
2958 */ 2904 */
2959 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 52, "Missing concrete implementation of '%s'"); 2905 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE ', 52, "Missing concrete implementation of %s");
2960 2906
2961 /** 2907 /**
2962 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 2908 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
2963 * abstract method. 2909 * abstract method.
2964 * 2910 *
2965 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 2911 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own
2966 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 2912 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i>
2967 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 2913 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
2968 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 2914 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
2969 * 2915 *
2970 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 2916 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
2971 * inherited in a concrete class unless that member overrides a concrete one. 2917 * inherited in a concrete class unless that member overrides a concrete one.
2972 * 2918 *
2973 * @param memberName the name of the first member 2919 * @param memberName the name of the first member
2974 * @param memberName the name of the second member 2920 * @param memberName the name of the second member
2975 * @param memberName the name of the third member 2921 * @param memberName the name of the third member
2976 */ 2922 */
2977 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE', 53, "Missing concrete implementation of '%s', '%s' and '%s'"); 2923 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_T HREE', 53, "Missing concrete implementation of %s, %s and %s");
2978 2924
2979 /** 2925 /**
2980 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 2926 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
2981 * abstract method. 2927 * abstract method.
2982 * 2928 *
2983 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 2929 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own
2984 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 2930 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i>
2985 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 2931 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit
2986 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 2932 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
2987 * 2933 *
2988 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 2934 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
2989 * inherited in a concrete class unless that member overrides a concrete one. 2935 * inherited in a concrete class unless that member overrides a concrete one.
2990 * 2936 *
2991 * @param memberName the name of the first member 2937 * @param memberName the name of the first member
2992 * @param memberName the name of the second member 2938 * @param memberName the name of the second member
2993 */ 2939 */
2994 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 54, "Missing concrete implementation of '%s' and '%s'"); 2940 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO ', 54, "Missing concrete implementation of %s and %s");
2995 2941
2996 /** 2942 /**
2997 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<s ub>2</sub>) s</i> or 2943 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<s ub>2</sub>) s</i> or
2998 * <i>on T s</i> matches an object <i>o</i> if the type of <i>o</i> is a subty pe of <i>T</i>. It 2944 * <i>on T s</i> matches an object <i>o</i> if the type of <i>o</i> is a subty pe of <i>T</i>. It
2999 * is a static warning if <i>T</i> does not denote a type available in the lex ical scope of the 2945 * is a static warning if <i>T</i> does not denote a type available in the lex ical scope of the
3000 * catch clause. 2946 * catch clause.
3001 * 2947 *
3002 * @param name the name of the non-type element 2948 * @param name the name of the non-type element
3003 */ 2949 */
3004 static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCod e.con1('NON_TYPE_IN_CATCH_CLAUSE', 55, "The name '%s' is not a type and cannot b e used in an on-catch clause"); 2950 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningC ode.con1('NON_TYPE_IN_CATCH_CLAUSE', 55, "The name '%s' is not a type and cannot be used in an on-catch clause");
3005 2951
3006 /** 2952 /**
3007 * 7.1.1 Operators: It is a static warning if the return type of the user-decl ared operator []= is 2953 * 7.1.1 Operators: It is a static warning if the return type of the user-decl ared operator []= is
3008 * explicitly declared and not void. 2954 * explicitly declared and not void.
3009 */ 2955 */
3010 static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarnin gCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 56, "The return type of the operator []= must be 'void'"); 2956 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarn ingCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 56, "The return type of the operato r []= must be 'void'");
3011 2957
3012 /** 2958 /**
3013 * 7.3 Setters: It is a static warning if a setter declares a return type othe r than void. 2959 * 7.3 Setters: It is a static warning if a setter declares a return type othe r than void.
3014 */ 2960 */
3015 static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningC ode.con1('NON_VOID_RETURN_FOR_SETTER', 57, "The return type of the setter must b e 'void'"); 2961 static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarnin gCode.con1('NON_VOID_RETURN_FOR_SETTER', 57, "The return type of the setter must be 'void'");
3016 2962
3017 /** 2963 /**
3018 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for m <i>id</i> or the 2964 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for m <i>id</i> or the
3019 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</ i> (respectively 2965 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</ i> (respectively
3020 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet er in the 2966 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet er in the
3021 * enclosing lexical scope, but occurs in the signature or body of a static me mber. * 2967 * enclosing lexical scope, but occurs in the signature or body of a static me mber. *
3022 * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, .., S<s ub>n</sub>&gt;</i>, 2968 * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, .., S<s ub>n</sub>&gt;</i>,
3023 * 2969 *
3024 * Any use of a malformed type gives rise to a static warning. 2970 * Any use of a malformed type gives rise to a static warning.
3025 * 2971 *
3026 * @param nonTypeName the name that is not a type 2972 * @param nonTypeName the name that is not a type
3027 */ 2973 */
3028 static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode.con1('NOT_A_ TYPE', 58, "%s is not a type"); 2974 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode.con1('NOT_ A_TYPE', 58, "%s is not a type");
3029 2975
3030 /** 2976 /**
3031 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 2977 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt;
3032 * n</i>. 2978 * n</i>.
3033 * 2979 *
3034 * @param requiredCount the expected number of required arguments 2980 * @param requiredCount the expected number of required arguments
3035 * @param argumentCount the actual number of positional arguments given 2981 * @param argumentCount the actual number of positional arguments given
3036 * @see #EXTRA_POSITIONAL_ARGUMENTS 2982 * @see #EXTRA_POSITIONAL_ARGUMENTS
3037 */ 2983 */
3038 static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarni ngCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 59, "%d required argument(s) expect ed, but %d found"); 2984 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar ningCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 59, "%d required argument(s) expe cted, but %d found");
3039 2985
3040 /** 2986 /**
3041 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p< /i> names a library 2987 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p< /i> names a library
3042 * other than the current library as the library to which <i>p</i> belongs. 2988 * other than the current library as the library to which <i>p</i> belongs.
3043 * 2989 *
3044 * @param expectedLibraryName the name of expected library name 2990 * @param expectedLibraryName the name of expected library name
3045 * @param actualLibraryName the non-matching actual library name from the "par t of" declaration 2991 * @param actualLibraryName the non-matching actual library name from the "par t of" declaration
3046 */ 2992 */
3047 static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCo de.con1('PART_OF_DIFFERENT_LIBRARY', 60, "Expected this library to be part of '% s', not '%s'"); 2993 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarning Code.con1('PART_OF_DIFFERENT_LIBRARY', 60, "Expected this library to be part of '%s', not '%s'");
3048 2994
3049 /** 2995 /**
3050 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of 2996 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of
3051 * the type of <i>k</i>. 2997 * the type of <i>k</i>.
3052 * 2998 *
3053 * @param redirectedName the name of the redirected constructor 2999 * @param redirectedName the name of the redirected constructor
3054 * @param redirectingName the name of the redirecting constructor 3000 * @param redirectingName the name of the redirecting constructor
3055 */ 3001 */
3056 static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticW arningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 61, "The redirected constru ctor '%s' has incompatible parameters with '%s'"); 3002 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const Stati cWarningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 61, "The redirected const ructor '%s' has incompatible parameters with '%s'");
3057 3003
3058 /** 3004 /**
3059 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of 3005 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of
3060 * the type of <i>k</i>. 3006 * the type of <i>k</i>.
3061 * 3007 *
3062 * @param redirectedName the name of the redirected constructor return type 3008 * @param redirectedName the name of the redirected constructor return type
3063 * @param redirectingName the name of the redirecting constructor return type 3009 * @param redirectingName the name of the redirecting constructor return type
3064 */ 3010 */
3065 static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWar ningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 62, "The return type '%s' of th e redirected constructor is not assignable to '%s'"); 3011 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticW arningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 62, "The return type '%s' of the redirected constructor is not assignable to '%s'");
3066 3012
3067 /** 3013 /**
3068 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the 3014 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the
3069 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the 3015 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the
3070 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. 3016 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>.
3071 */ 3017 */
3072 static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWar ningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 63, "The constructor '%s' could not be found in '%s'"); 3018 static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticW arningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 63, "The constructor '%s' cou ld not be found in '%s'");
3073 3019
3074 /** 3020 /**
3075 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the 3021 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the
3076 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the 3022 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the
3077 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. 3023 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>.
3078 */ 3024 */
3079 static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode.c on1('REDIRECT_TO_NON_CLASS', 64, "The name '%s' is not a type and cannot be used in a redirected constructor"); 3025 static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode .con1('REDIRECT_TO_NON_CLASS', 64, "The name '%s' is not a type and cannot be us ed in a redirected constructor");
3080 3026
3081 /** 3027 /**
3082 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s tatement of the form 3028 * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return s tatement of the form
3083 * <i>return;</i> It is a static warning if both of the following conditions h old: 3029 * <i>return;</i> It is a static warning if both of the following conditions h old:
3084 * <ol> 3030 * <ol>
3085 * * <i>f</i> is not a generative constructor. 3031 * * <i>f</i> is not a generative constructor.
3086 * * The return type of <i>f</i> may not be assigned to void. 3032 * * The return type of <i>f</i> may not be assigned to void.
3087 * </ol> 3033 * </ol>
3088 */ 3034 */
3089 static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode.co n1('RETURN_WITHOUT_VALUE', 65, "Missing return value after 'return'"); 3035 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode. con1('RETURN_WITHOUT_VALUE', 65, "Missing return value after 'return'");
3090 3036
3091 /** 3037 /**
3092 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method 3038 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method
3093 * or getter <i>m</i>. 3039 * or getter <i>m</i>.
3094 * 3040 *
3095 * @param memberName the name of the instance member 3041 * @param memberName the name of the instance member
3096 */ 3042 */
3097 static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWa rningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 66, "Instance member '%s' can not be accessed using static access"); 3043 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const Static WarningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 66, "Instance member '%s' c annot be accessed using static access");
3098 3044
3099 /** 3045 /**
3100 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi gned to the type of 3046 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi gned to the type of
3101 * <i>e<sub>k</sub></i>. 3047 * <i>e<sub>k</sub></i>.
3102 */ 3048 */
3103 static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWa rningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 67, "Type '%s' of the switch expression is not assignable to the type '%s' of case expressions"); 3049 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const Static WarningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 67, "Type '%s' of the switc h expression is not assignable to the type '%s' of case expressions");
3104 3050
3105 /** 3051 /**
3106 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the 3052 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the
3107 * current lexical scope. 3053 * current lexical scope.
3108 */ 3054 */
3109 static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode.con1 ('TYPE_TEST_NON_TYPE', 68, "The name '%s' is not a type and cannot be used in an 'is' expression"); 3055 static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode.co n1('TYPE_TEST_NON_TYPE', 68, "The name '%s' is not a type and cannot be used in an 'is' expression");
3110 3056
3111 /** 3057 /**
3112 * 10 Generics: However, a type parameter is considered to be a malformed type when referenced by 3058 * 10 Generics: However, a type parameter is considered to be a malformed type when referenced by
3113 * a static member. 3059 * a static member.
3114 * 3060 *
3115 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni ng. A malformed type 3061 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni ng. A malformed type
3116 * is then interpreted as dynamic by the static type checker and the runtime. 3062 * is then interpreted as dynamic by the static type checker and the runtime.
3117 */ 3063 */
3118 static final StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = new Stati cWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 69, "Static members can not reference type parameters"); 3064 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const Sta ticWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 69, "Static members c annot reference type parameters");
3119 3065
3120 /** 3066 /**
3121 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form 3067 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
3122 * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, &hellip; 3068 * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, &hellip;
3123 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> d oes not denote a 3069 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> d oes not denote a
3124 * class in the current scope. 3070 * class in the current scope.
3125 * 3071 *
3126 * @param undefinedClassName the name of the undefined class 3072 * @param undefinedClassName the name of the undefined class
3127 */ 3073 */
3128 static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode.con1('U NDEFINED_CLASS', 70, "Undefined class '%s'"); 3074 static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode.con1( 'UNDEFINED_CLASS', 70, "Undefined class '%s'");
3129 3075
3130 /** 3076 /**
3131 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". 3077 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
3132 */ 3078 */
3133 static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode .con1('UNDEFINED_CLASS_BOOLEAN', 71, "Undefined class 'boolean'; did you mean 'b ool'?"); 3079 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCo de.con1('UNDEFINED_CLASS_BOOLEAN', 71, "Undefined class 'boolean'; did you mean 'bool'?");
3134 3080
3135 /** 3081 /**
3136 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing 3082 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing
3137 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter 3083 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter
3138 * named <i>m</i>. 3084 * named <i>m</i>.
3139 * 3085 *
3140 * @param getterName the name of the getter 3086 * @param getterName the name of the getter
3141 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for 3087 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for
3142 */ 3088 */
3143 static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode.con1(' UNDEFINED_GETTER', 72, "There is no such getter '%s' in '%s'"); 3089 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode.con1 ('UNDEFINED_GETTER', 72, "There is no such getter '%s' in '%s'");
3144 3090
3145 /** 3091 /**
3146 * 12.30 Identifier Reference: It is as static warning if an identifier expres sion of the form 3092 * 12.30 Identifier Reference: It is as static warning if an identifier expres sion of the form
3147 * <i>id</i> occurs inside a top level or static function (be it function, met hod, getter, or 3093 * <i>id</i> occurs inside a top level or static function (be it function, met hod, getter, or
3148 * setter) or variable initializer and there is no declaration <i>d</i> with n ame <i>id</i> in the 3094 * setter) or variable initializer and there is no declaration <i>d</i> with n ame <i>id</i> in the
3149 * lexical scope enclosing the expression. 3095 * lexical scope enclosing the expression.
3150 * 3096 *
3151 * @param name the name of the identifier 3097 * @param name the name of the identifier
3152 */ 3098 */
3153 static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode.co n1('UNDEFINED_IDENTIFIER', 73, "Undefined name '%s'"); 3099 static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode. con1('UNDEFINED_IDENTIFIER', 73, "Undefined name '%s'");
3154 3100
3155 /** 3101 /**
3156 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, 3102 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
3157 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... 3103 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ...
3158 * <i>p<sub>n+k</sub></i>} or a static warning occurs. 3104 * <i>p<sub>n+k</sub></i>} or a static warning occurs.
3159 * 3105 *
3160 * @param name the name of the requested named parameter 3106 * @param name the name of the requested named parameter
3161 */ 3107 */
3162 static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCo de.con1('UNDEFINED_NAMED_PARAMETER', 74, "The named parameter '%s' is not define d"); 3108 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarning Code.con1('UNDEFINED_NAMED_PARAMETER', 74, "The named parameter '%s' is not defi ned");
3163 3109
3164 /** 3110 /**
3165 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs 3111 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs
3166 * inside a top level or static function (be it function, method, getter, or s etter) or variable 3112 * inside a top level or static function (be it function, method, getter, or s etter) or variable
3167 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope 3113 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope
3168 * enclosing the assignment. 3114 * enclosing the assignment.
3169 * 3115 *
3170 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t he enclosing lexical 3116 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t he enclosing lexical
3171 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp licitly, a setter 3117 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp licitly, a setter
3172 * <i>v=</i>. 3118 * <i>v=</i>.
3173 * 3119 *
3174 * @param setterName the name of the getter 3120 * @param setterName the name of the getter
3175 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for 3121 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for
3176 */ 3122 */
3177 static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode.con1(' UNDEFINED_SETTER', 75, "There is no such setter '%s' in '%s'"); 3123 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode.con1 ('UNDEFINED_SETTER', 75, "There is no such setter '%s' in '%s'");
3178 3124
3179 /** 3125 /**
3180 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method 3126 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method
3181 * or getter <i>m</i>. 3127 * or getter <i>m</i>.
3182 * 3128 *
3183 * @param methodName the name of the method 3129 * @param methodName the name of the method
3184 * @param enclosingType the name of the enclosing type where the method is bei ng looked for 3130 * @param enclosingType the name of the enclosing type where the method is bei ng looked for
3185 */ 3131 */
3186 static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticW arningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 76, "There is no such stati c method, getter or setter '%s' in '%s'"); 3132 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const Stati cWarningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 76, "There is no such sta tic method, getter or setter '%s' in '%s'");
3187 3133
3188 static final List<StaticWarningCode> values = [ 3134 /**
3135 * 7.2 Getters: It is a static warning if the return type of a getter is void.
3136 */
3137 static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCod e.con1('VOID_RETURN_FOR_GETTER', 77, "The return type of the getter must not be 'void'");
3138
3139 static const List<StaticWarningCode> values = const [
3189 AMBIGUOUS_IMPORT, 3140 AMBIGUOUS_IMPORT,
3190 ARGUMENT_TYPE_NOT_ASSIGNABLE, 3141 ARGUMENT_TYPE_NOT_ASSIGNABLE,
3191 ASSIGNMENT_TO_CONST, 3142 ASSIGNMENT_TO_CONST,
3192 ASSIGNMENT_TO_FINAL, 3143 ASSIGNMENT_TO_FINAL,
3193 ASSIGNMENT_TO_METHOD, 3144 ASSIGNMENT_TO_METHOD,
3194 CASE_BLOCK_NOT_TERMINATED, 3145 CASE_BLOCK_NOT_TERMINATED,
3195 CAST_TO_NON_TYPE, 3146 CAST_TO_NON_TYPE,
3196 CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, 3147 CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
3197 CONFLICTING_DART_IMPORT, 3148 CONFLICTING_DART_IMPORT,
3198 CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, 3149 CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
3255 STATIC_ACCESS_TO_INSTANCE_MEMBER, 3206 STATIC_ACCESS_TO_INSTANCE_MEMBER,
3256 SWITCH_EXPRESSION_NOT_ASSIGNABLE, 3207 SWITCH_EXPRESSION_NOT_ASSIGNABLE,
3257 TYPE_TEST_NON_TYPE, 3208 TYPE_TEST_NON_TYPE,
3258 TYPE_PARAMETER_REFERENCED_BY_STATIC, 3209 TYPE_PARAMETER_REFERENCED_BY_STATIC,
3259 UNDEFINED_CLASS, 3210 UNDEFINED_CLASS,
3260 UNDEFINED_CLASS_BOOLEAN, 3211 UNDEFINED_CLASS_BOOLEAN,
3261 UNDEFINED_GETTER, 3212 UNDEFINED_GETTER,
3262 UNDEFINED_IDENTIFIER, 3213 UNDEFINED_IDENTIFIER,
3263 UNDEFINED_NAMED_PARAMETER, 3214 UNDEFINED_NAMED_PARAMETER,
3264 UNDEFINED_SETTER, 3215 UNDEFINED_SETTER,
3265 UNDEFINED_STATIC_METHOD_OR_GETTER]; 3216 UNDEFINED_STATIC_METHOD_OR_GETTER,
3217 VOID_RETURN_FOR_GETTER];
3266 3218
3267 /** 3219 /**
3268 * The template used to create the message to be displayed for this error. 3220 * The template used to create the message to be displayed for this error.
3269 */ 3221 */
3270 String message; 3222 final String message;
3271 3223
3272 /** 3224 /**
3273 * The template used to create the correction to be displayed for this error, or `null` if 3225 * The template used to create the correction to be displayed for this error, or `null` if
3274 * there is no correction information for this error. 3226 * there is no correction information for this error.
3275 */ 3227 */
3276 String correction7; 3228 final String correction;
3277 3229
3278 /** 3230 /**
3279 * Initialize a newly created error code to have the given message. 3231 * Initialize a newly created error code to have the given message.
3280 * 3232 *
3281 * @param message the message template used to create the message to be displa yed for the error 3233 * @param message the message template used to create the message to be displa yed for the error
3282 */ 3234 */
3283 StaticWarningCode.con1(String name, int ordinal, String message) : super(name, ordinal) { 3235 const StaticWarningCode.con1(String name, int ordinal, String message) : this. con2(name, ordinal, message, null);
3284 this.message = message;
3285 }
3286 3236
3287 /** 3237 /**
3288 * Initialize a newly created error code to have the given message and correct ion. 3238 * Initialize a newly created error code to have the given message and correct ion.
3289 * 3239 *
3290 * @param message the template used to create the message to be displayed for the error 3240 * @param message the template used to create the message to be displayed for the error
3291 * @param correction the template used to create the correction to be displaye d for the error 3241 * @param correction the template used to create the correction to be displaye d for the error
3292 */ 3242 */
3293 StaticWarningCode.con2(String name, int ordinal, String message, String correc tion) : super(name, ordinal) { 3243 const StaticWarningCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal);
3294 this.message = message;
3295 this.correction7 = correction;
3296 }
3297
3298 @override
3299 String get correction => correction7;
3300 3244
3301 @override 3245 @override
3302 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; 3246 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
3303 3247
3304 @override 3248 @override
3305 ErrorType get type => ErrorType.STATIC_WARNING; 3249 ErrorType get type => ErrorType.STATIC_WARNING;
3306 } 3250 }
3307 3251
3308 /** 3252 /**
3309 * The interface `AnalysisErrorListener` defines the behavior of objects that li sten for 3253 * The interface `AnalysisErrorListener` defines the behavior of objects that li sten for
(...skipping 25 matching lines...) Expand all
3335 * caused the error to be generated and for the error message to explain what is wrong and, when 3279 * caused the error to be generated and for the error message to explain what is wrong and, when
3336 * appropriate, how the problem can be corrected. 3280 * appropriate, how the problem can be corrected.
3337 */ 3281 */
3338 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { 3282 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode {
3339 /** 3283 /**
3340 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag is not a 3284 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag is not a
3341 * valid URI. 3285 * valid URI.
3342 * 3286 *
3343 * @param uri the URI that is invalid 3287 * @param uri the URI that is invalid
3344 */ 3288 */
3345 static final HtmlWarningCode INVALID_URI = new HtmlWarningCode.con1('INVALID_U RI', 0, "Invalid URI syntax: '%s'"); 3289 static const HtmlWarningCode INVALID_URI = const HtmlWarningCode.con1('INVALID _URI', 0, "Invalid URI syntax: '%s'");
3346 3290
3347 /** 3291 /**
3348 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag references 3292 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag references
3349 * a file that does not exist. 3293 * a file that does not exist.
3350 * 3294 *
3351 * @param uri the URI pointing to a non-existent file 3295 * @param uri the URI pointing to a non-existent file
3352 */ 3296 */
3353 static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode.con1('UR I_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'"); 3297 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode.con1(' URI_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'");
3354 3298
3355 static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST]; 3299 static const List<HtmlWarningCode> values = const [INVALID_URI, URI_DOES_NOT_E XIST];
3356 3300
3357 /** 3301 /**
3358 * The template used to create the message to be displayed for this error. 3302 * The template used to create the message to be displayed for this error.
3359 */ 3303 */
3360 String message; 3304 final String message;
3361 3305
3362 /** 3306 /**
3363 * The template used to create the correction to be displayed for this error, or `null` if 3307 * The template used to create the correction to be displayed for this error, or `null` if
3364 * there is no correction information for this error. 3308 * there is no correction information for this error.
3365 */ 3309 */
3366 String correction4; 3310 final String correction;
3367 3311
3368 /** 3312 /**
3369 * Initialize a newly created error code to have the given message. 3313 * Initialize a newly created error code to have the given message.
3370 * 3314 *
3371 * @param message the message template used to create the message to be displa yed for the error 3315 * @param message the message template used to create the message to be displa yed for the error
3372 */ 3316 */
3373 HtmlWarningCode.con1(String name, int ordinal, String message) : super(name, o rdinal) { 3317 const HtmlWarningCode.con1(String name, int ordinal, String message) : this.co n2(name, ordinal, message, null);
3374 this.message = message;
3375 }
3376 3318
3377 /** 3319 /**
3378 * Initialize a newly created error code to have the given message and correct ion. 3320 * Initialize a newly created error code to have the given message and correct ion.
3379 * 3321 *
3380 * @param message the template used to create the message to be displayed for the error 3322 * @param message the template used to create the message to be displayed for the error
3381 * @param correction the template used to create the correction to be displaye d for the error 3323 * @param correction the template used to create the correction to be displaye d for the error
3382 */ 3324 */
3383 HtmlWarningCode.con2(String name, int ordinal, String message, String correcti on) : super(name, ordinal) { 3325 const HtmlWarningCode.con2(String name, int ordinal, this.message, this.correc tion) : super(name, ordinal);
3384 this.message = message;
3385 this.correction4 = correction;
3386 }
3387
3388 @override
3389 String get correction => correction4;
3390 3326
3391 @override 3327 @override
3392 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; 3328 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
3393 3329
3394 @override 3330 @override
3395 ErrorType get type => ErrorType.STATIC_WARNING; 3331 ErrorType get type => ErrorType.STATIC_WARNING;
3396 } 3332 }
3397 3333
3398 /** 3334 /**
3399 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat ic type 3335 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat ic type
3400 * warnings. The convention for this class is for the name of the error code to indicate the problem 3336 * warnings. The convention for this class is for the name of the error code to indicate the problem
3401 * that caused the error to be generated and for the error message to explain wh at is wrong and, 3337 * that caused the error to be generated and for the error message to explain wh at is wrong and,
3402 * when appropriate, how the problem can be corrected. 3338 * when appropriate, how the problem can be corrected.
3403 */ 3339 */
3404 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code { 3340 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code {
3405 /** 3341 /**
3406 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas s implements the 3342 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas s implements the
3407 * built-in class <i>List&lt;E></i> is allocated. 3343 * built-in class <i>List&lt;E></i> is allocated.
3408 * 3344 *
3409 * @param numTypeArgument the number of provided type arguments 3345 * @param numTypeArgument the number of provided type arguments
3410 */ 3346 */
3411 static final StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = new Stat icTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal requ ires exactly one type arguments or none, but %d found"); 3347 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const St aticTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal re quires exactly one type arguments or none, but %d found");
3412 3348
3413 /** 3349 /**
3414 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the 3350 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the
3415 * built-in class <i>Map&lt;K, V></i> is allocated. 3351 * built-in class <i>Map&lt;K, V></i> is allocated.
3416 * 3352 *
3417 * @param numTypeArgument the number of provided type arguments 3353 * @param numTypeArgument the number of provided type arguments
3418 */ 3354 */
3419 static final StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = new Stati cTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal require s exactly two type arguments or none, but %d found"); 3355 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta ticTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal requi res exactly two type arguments or none, but %d found");
3420 3356
3421 /** 3357 /**
3422 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 3358 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
3423 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. 3359 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>.
3424 * 3360 *
3425 * @see #UNDEFINED_SETTER 3361 * @see #UNDEFINED_SETTER
3426 */ 3362 */
3427 static final StaticTypeWarningCode INACCESSIBLE_SETTER = new StaticTypeWarning Code.con1('INACCESSIBLE_SETTER', 2, ""); 3363 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni ngCode.con1('INACCESSIBLE_SETTER', 2, "");
3428 3364
3429 /** 3365 /**
3430 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i >m<sub>1</sub>, 3366 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i >m<sub>1</sub>,
3431 * &hellip; m<sub>k</sub></i> with the same name <i>n</i> that would be inheri ted (because 3367 * &hellip; m<sub>k</sub></i> with the same name <i>n</i> that would be inheri ted (because
3432 * identically named members existed in several superinterfaces) then at most one member is 3368 * identically named members existed in several superinterfaces) then at most one member is
3433 * inherited. 3369 * inherited.
3434 * 3370 *
3435 * If the static types <i>T<sub>1</sub>, &hellip;, T<sub>k</sub></i> of the me mbers 3371 * If the static types <i>T<sub>1</sub>, &hellip;, T<sub>k</sub></i> of the me mbers
3436 * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> are not identical, then there must be a member 3372 * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> are not identical, then there must be a member
3437 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> &lt; T<sub>i</sub>, 1 &lt;= x &lt;= k</i> for 3373 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> &lt; T<sub>i</sub>, 1 &lt;= x &lt;= k</i> for
3438 * all <i>i, 1 &lt;= i &lt; k</i>, or a static type warning occurs. The member that is inherited 3374 * all <i>i, 1 &lt;= i &lt; k</i>, or a static type warning occurs. The member that is inherited
3439 * is <i>m<sub>x</sub></i>, if it exists; otherwise: 3375 * is <i>m<sub>x</sub></i>, if it exists; otherwise:
3440 * <ol> 3376 * <ol>
3441 * * If all of <i>m<sub>1</sub>, &hellip; m<sub>k</sub></i> have the same numb er <i>r</i> of 3377 * * If all of <i>m<sub>1</sub>, &hellip; m<sub>k</sub></i> have the same numb er <i>r</i> of
3442 * required parameters and the same set of named parameters <i>s</i>, then let <i>h = max( 3378 * required parameters and the same set of named parameters <i>s</i>, then let <i>h = max(
3443 * numberOfOptionalPositionals( m<sub>i</sub> ) ), 1 &lt;= i &lt;= k</i>. <i>I </i> has a method 3379 * numberOfOptionalPositionals( m<sub>i</sub> ) ), 1 &lt;= i &lt;= k</i>. <i>I </i> has a method
3444 * named <i>n</i>, with <i>r</i> required parameters of type dynamic, <i>h</i> optional positional 3380 * named <i>n</i>, with <i>r</i> required parameters of type dynamic, <i>h</i> optional positional
3445 * parameters of type dynamic, named parameters <i>s</i> of type dynamic and r eturn type dynamic. 3381 * parameters of type dynamic, named parameters <i>s</i> of type dynamic and r eturn type dynamic.
3446 * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></ i> is inherited. 3382 * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></ i> is inherited.
3447 * </ol> 3383 * </ol>
3448 */ 3384 */
3449 static final StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = new Stati cTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'%s' is inherited b y at least two interfaces inconsistently, from %s"); 3385 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta ticTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'%s' is inherited by at least two interfaces inconsistently, from %s");
3450 3386
3451 /** 3387 /**
3452 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an 3388 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an
3453 * accessible (3.2) instance member named <i>m</i>. 3389 * accessible (3.2) instance member named <i>m</i>.
3454 * 3390 *
3455 * @param memberName the name of the static member 3391 * @param memberName the name of the static member
3456 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER 3392 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER
3457 */ 3393 */
3458 static final StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = new Stat icTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member '%s ' cannot be accessed using instance access"); 3394 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St aticTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member ' %s' cannot be accessed using instance access");
3459 3395
3460 /** 3396 /**
3461 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be 3397 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be
3462 * assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the 3398 * assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the
3463 * static type of <i>e</i>. 3399 * static type of <i>e</i>.
3464 * 3400 *
3465 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be 3401 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be
3466 * assigned to the static type of <i>C.v</i>. The static type of the expressio n <i>C.v = e</i> is 3402 * assigned to the static type of <i>C.v</i>. The static type of the expressio n <i>C.v = e</i> is
3467 * the static type of <i>e</i>. 3403 * the static type of <i>e</i>.
3468 * 3404 *
3469 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 3405 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
3470 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to < i>T</i>. 3406 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to < i>T</i>.
3471 * 3407 *
3472 * @param rhsTypeName the name of the right hand side type 3408 * @param rhsTypeName the name of the right hand side type
3473 * @param lhsTypeName the name of the left hand side type 3409 * @param lhsTypeName the name of the left hand side type
3474 */ 3410 */
3475 static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningC ode.con1('INVALID_ASSIGNMENT', 5, "A value of type '%s' cannot be assigned to a variable of type '%s'"); 3411 static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarnin gCode.con1('INVALID_ASSIGNMENT', 5, "A value of type '%s' cannot be assigned to a variable of type '%s'");
3476 3412
3477 /** 3413 /**
3478 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form 3414 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form
3479 * <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, &hellip; 3415 * <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, &hellip;
3480 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. 3416 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
3481 * 3417 *
3482 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not 3418 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not
3483 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning 3419 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning
3484 * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does 3420 * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does
3485 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</ i> is dynamic. 3421 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</ i> is dynamic.
3486 * 3422 *
3487 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may 3423 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may
3488 * not be assigned to a function type. 3424 * not be assigned to a function type.
3489 * 3425 *
3490 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 3426 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
3491 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 3427 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip;
3492 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static warning if the type 3428 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static warning if the type
3493 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. 3429 * <i>F</i> of <i>S.m</i> may not be assigned to a function type.
3494 * 3430 *
3495 * @param nonFunctionIdentifier the name of the identifier that is not a funct ion type 3431 * @param nonFunctionIdentifier the name of the identifier that is not a funct ion type
3496 */ 3432 */
3497 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = new StaticType WarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'%s' is not a method"); 3433 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTy peWarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'%s' is not a method");
3498 3434
3499 /** 3435 /**
3500 * 12.14.4 Function Expression Invocation: A function expression invocation <i >i</i> has the form 3436 * 12.14.4 Function Expression Invocation: A function expression invocation <i >i</i> has the form
3501 * <i>e<sub>f</sub>(a<sub>1</sub>, &hellip; a<sub>n</sub>, x<sub>n+1</sub>: a< sub>n+1</sub>, 3437 * <i>e<sub>f</sub>(a<sub>1</sub>, &hellip; a<sub>n</sub>, x<sub>n+1</sub>: a< sub>n+1</sub>,
3502 * &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression. 3438 * &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression.
3503 * 3439 *
3504 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub> </i> may not be 3440 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub> </i> may not be
3505 * assigned to a function type. 3441 * assigned to a function type.
3506 */ 3442 */
3507 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = new StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Cannot invoke a non-function"); 3443 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = con st StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Canno t invoke a non-function");
3508 3444
3509 /** 3445 /**
3510 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be 3446 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be
3511 * assigned to bool. 3447 * assigned to bool.
3512 * 3448 *
3513 * 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned 3449 * 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned
3514 * to bool. 3450 * to bool.
3515 * 3451 *
3516 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool. 3452 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool.
3517 * 3453 *
3518 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi gned to bool. 3454 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi gned to bool.
3519 */ 3455 */
3520 static final StaticTypeWarningCode NON_BOOL_CONDITION = new StaticTypeWarningC ode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool'" ); 3456 static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarnin gCode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool '");
3521 3457
3522 /** 3458 /**
3523 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b e assigned to either 3459 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b e assigned to either
3524 * bool or () &rarr; bool 3460 * bool or () &rarr; bool
3525 */ 3461 */
3526 static final StaticTypeWarningCode NON_BOOL_EXPRESSION = new StaticTypeWarning Code.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '( ) -> bool'"); 3462 static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarni ngCode.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '() -> bool'");
3527 3463
3528 /** 3464 /**
3529 * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expr ession 3465 * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expr ession
3530 * <i>e</i>?<b>false<b> : <b>true</b>. 3466 * <i>e</i>?<b>false<b> : <b>true</b>.
3531 * 3467 *
3532 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be 3468 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be
3533 * assigned to bool. 3469 * assigned to bool.
3534 */ 3470 */
3535 static final StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = new StaticTy peWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must h ave a static type of 'bool'"); 3471 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const Static TypeWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must have a static type of 'bool'");
3536 3472
3537 /** 3473 /**
3538 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 &lt;= i &lt;= 3474 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 &lt;= i &lt;=
3539 * n</i> does not denote a type in the enclosing lexical scope. 3475 * n</i> does not denote a type in the enclosing lexical scope.
3540 */ 3476 */
3541 static final StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = new StaticTypeW arningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 11, "The name '%s' is not a type an d cannot be used as a parameterized type"); 3477 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTyp eWarningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 11, "The name '%s' is not a type and cannot be used as a parameterized type");
3542 3478
3543 /** 3479 /**
3544 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b e assigned to the 3480 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b e assigned to the
3545 * declared return type of the immediately enclosing function. 3481 * declared return type of the immediately enclosing function.
3546 * 3482 *
3547 * @param actualReturnType the return type as declared in the return statement 3483 * @param actualReturnType the return type as declared in the return statement
3548 * @param expectedReturnType the expected return type as defined by the method 3484 * @param expectedReturnType the expected return type as defined by the method
3549 * @param methodName the name of the method 3485 * @param methodName the name of the method
3550 */ 3486 */
3551 static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarn ingCode.con1('RETURN_OF_INVALID_TYPE', 12, "The return type '%s' is not a '%s', as defined by the method '%s'"); 3487 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWa rningCode.con1('RETURN_OF_INVALID_TYPE', 12, "The return type '%s' is not a '%s' , as defined by the method '%s'");
3552 3488
3553 /** 3489 /**
3554 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a 3490 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a
3555 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object 3491 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object
3556 * expression are not subtypes of the bounds of the corresponding formal type parameters of 3492 * expression are not subtypes of the bounds of the corresponding formal type parameters of
3557 * <i>G</i>. 3493 * <i>G</i>.
3558 * 3494 *
3559 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</ i> of <i>G</i>, then 3495 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</ i> of <i>G</i>, then
3560 * the static type of the member <i>m</i> of <i>G&lt;A<sub>1</sub>, &hellip; A <sub>n</sub>&gt;</i> 3496 * the static type of the member <i>m</i> of <i>G&lt;A<sub>1</sub>, &hellip; A <sub>n</sub>&gt;</i>
3561 * is <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<su b>n</sub>]S</i> 3497 * is <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<su b>n</sub>]S</i>
3562 * where <i>T<sub>1</sub>, &hellip; T<sub>n</sub></i> are the formal type para meters of <i>G</i>. 3498 * where <i>T<sub>1</sub>, &hellip; T<sub>n</sub></i> are the formal type para meters of <i>G</i>.
3563 * Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a 3499 * Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a
3564 * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1 </sub>, &hellip;, 3500 * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1 </sub>, &hellip;,
3565 * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;= i &lt;= n</i>. 3501 * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;= i &lt;= n</i>.
3566 * 3502 *
3567 * 7.6.2 Factories: It is a static type warning if any of the type arguments t o <i>k'</i> are not 3503 * 7.6.2 Factories: It is a static type warning if any of the type arguments t o <i>k'</i> are not
3568 * subtypes of the bounds of the corresponding formal type parameters of type. 3504 * subtypes of the bounds of the corresponding formal type parameters of type.
3569 * 3505 *
3570 * @param boundedTypeName the name of the type used in the instance creation t hat should be 3506 * @param boundedTypeName the name of the type used in the instance creation t hat should be
3571 * limited by the bound as specified in the class declaration 3507 * limited by the bound as specified in the class declaration
3572 * @param boundingTypeName the name of the bounding type 3508 * @param boundingTypeName the name of the bounding type
3573 * @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND 3509 * @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND
3574 */ 3510 */
3575 static final StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Sta ticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 13, "'%s' does not extend '%s'"); 3511 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S taticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 13, "'%s' does no t extend '%s'");
3576 3512
3577 /** 3513 /**
3578 * 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound. 3514 * 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound.
3579 * 3515 *
3580 * @param typeParameterName the name of the type parameter 3516 * @param typeParameterName the name of the type parameter
3581 * @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS 3517 * @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
3582 */ 3518 */
3583 static final StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = new StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 14, "'%s' c annot be a supertype of its upper bound"); 3519 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con st StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 14, "'%s' cannot be a supertype of its upper bound");
3584 3520
3585 /** 3521 /**
3586 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type 3522 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type
3587 * warning if <i>T</i> does not have a getter named <i>m</i>. 3523 * warning if <i>T</i> does not have a getter named <i>m</i>.
3588 * 3524 *
3589 * @param getterName the name of the getter 3525 * @param getterName the name of the getter
3590 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for 3526 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for
3591 */ 3527 */
3592 static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCod e.con1('UNDEFINED_GETTER', 15, "There is no such getter '%s' in '%s'"); 3528 static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningC ode.con1('UNDEFINED_GETTER', 15, "There is no such getter '%s' in '%s'");
3593 3529
3594 /** 3530 /**
3595 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type 3531 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type
3596 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. 3532 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>.
3597 * 3533 *
3598 * @param methodName the name of the method that is undefined 3534 * @param methodName the name of the method that is undefined
3599 * @param typeName the resolved type name that the method lookup is happening on 3535 * @param typeName the resolved type name that the method lookup is happening on
3600 */ 3536 */
3601 static final StaticTypeWarningCode UNDEFINED_METHOD = new StaticTypeWarningCod e.con1('UNDEFINED_METHOD', 16, "The method '%s' is not defined for the class '%s '"); 3537 static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningC ode.con1('UNDEFINED_METHOD', 16, "The method '%s' is not defined for the class ' %s'");
3602 3538
3603 /** 3539 /**
3604 * 12.18 Assignment: Evaluation of an assignment of the form 3540 * 12.18 Assignment: Evaluation of an assignment of the form
3605 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva lent to the 3541 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva lent to the
3606 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1< /sub></i>, 3542 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1< /sub></i>,
3607 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>). 3543 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>).
3608 * 3544 *
3609 * 12.29 Assignable Expressions: An assignable expression of the form 3545 * 12.29 Assignable Expressions: An assignable expression of the form
3610 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat ion of the operator 3546 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat ion of the operator
3611 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>. 3547 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>.
3612 * 3548 *
3613 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type 3549 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type
3614 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. 3550 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>.
3615 * 3551 *
3616 * @param operator the name of the operator 3552 * @param operator the name of the operator
3617 * @param enclosingType the name of the enclosing type where the operator is b eing looked for 3553 * @param enclosingType the name of the enclosing type where the operator is b eing looked for
3618 */ 3554 */
3619 static final StaticTypeWarningCode UNDEFINED_OPERATOR = new StaticTypeWarningC ode.con1('UNDEFINED_OPERATOR', 17, "There is no such operator '%s' in '%s'"); 3555 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin gCode.con1('UNDEFINED_OPERATOR', 17, "There is no such operator '%s' in '%s'");
3620 3556
3621 /** 3557 /**
3622 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 3558 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
3623 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. 3559 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>.
3624 * 3560 *
3625 * @param setterName the name of the setter 3561 * @param setterName the name of the setter
3626 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for 3562 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for
3627 * @see #INACCESSIBLE_SETTER 3563 * @see #INACCESSIBLE_SETTER
3628 */ 3564 */
3629 static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCod e.con1('UNDEFINED_SETTER', 18, "There is no such setter '%s' in '%s'"); 3565 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC ode.con1('UNDEFINED_SETTER', 18, "There is no such setter '%s' in '%s'");
3630 3566
3631 /** 3567 /**
3632 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 3568 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
3633 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 3569 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip;
3634 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S< /i> does not have an 3570 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S< /i> does not have an
3635 * accessible instance member named <i>m</i>. 3571 * accessible instance member named <i>m</i>.
3636 * 3572 *
3637 * @param methodName the name of the method that is undefined 3573 * @param methodName the name of the method that is undefined
3638 * @param typeName the resolved type name that the method lookup is happening on 3574 * @param typeName the resolved type name that the method lookup is happening on
3639 */ 3575 */
3640 static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarn ingCode.con1('UNDEFINED_SUPER_METHOD', 19, "There is no such method '%s' in '%s' "); 3576 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWa rningCode.con1('UNDEFINED_SUPER_METHOD', 19, "There is no such method '%s' in '% s'");
3641 3577
3642 /** 3578 /**
3643 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an 3579 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an
3644 * accessible (3.2) instance member named <i>m</i>. 3580 * accessible (3.2) instance member named <i>m</i>.
3645 * 3581 *
3646 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used when we are 3582 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used when we are
3647 * able to find the name defined in a supertype. It exists to provide a more i nformative error 3583 * able to find the name defined in a supertype. It exists to provide a more i nformative error
3648 * message. 3584 * message.
3649 */ 3585 */
3650 static final StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = new StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATI C_MEMBER', 20, "Static members from supertypes must be qualified by the name of the defining type"); 3586 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = const StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STA TIC_MEMBER', 20, "Static members from supertypes must be qualified by the name o f the defining type");
3651 3587
3652 /** 3588 /**
3653 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with 3589 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with
3654 * exactly <i>n</i> type parameters. 3590 * exactly <i>n</i> type parameters.
3655 * 3591 *
3656 * @param typeName the name of the type being referenced (<i>G</i>) 3592 * @param typeName the name of the type being referenced (<i>G</i>)
3657 * @param parameterCount the number of type parameters that were declared 3593 * @param parameterCount the number of type parameters that were declared
3658 * @param argumentCount the number of type arguments provided 3594 * @param argumentCount the number of type arguments provided
3659 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS 3595 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS
3660 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS 3596 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
3661 */ 3597 */
3662 static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new Static TypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 21, "The type '%s' is dec lared with %d type parameters, but %d type arguments were given"); 3598 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat icTypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 21, "The type '%s' is d eclared with %d type parameters, but %d type arguments were given");
3663 3599
3664 static final List<StaticTypeWarningCode> values = [ 3600 static const List<StaticTypeWarningCode> values = const [
3665 EXPECTED_ONE_LIST_TYPE_ARGUMENTS, 3601 EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
3666 EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 3602 EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
3667 INACCESSIBLE_SETTER, 3603 INACCESSIBLE_SETTER,
3668 INCONSISTENT_METHOD_INHERITANCE, 3604 INCONSISTENT_METHOD_INHERITANCE,
3669 INSTANCE_ACCESS_TO_STATIC_MEMBER, 3605 INSTANCE_ACCESS_TO_STATIC_MEMBER,
3670 INVALID_ASSIGNMENT, 3606 INVALID_ASSIGNMENT,
3671 INVOCATION_OF_NON_FUNCTION, 3607 INVOCATION_OF_NON_FUNCTION,
3672 INVOCATION_OF_NON_FUNCTION_EXPRESSION, 3608 INVOCATION_OF_NON_FUNCTION_EXPRESSION,
3673 NON_BOOL_CONDITION, 3609 NON_BOOL_CONDITION,
3674 NON_BOOL_EXPRESSION, 3610 NON_BOOL_EXPRESSION,
3675 NON_BOOL_NEGATION_EXPRESSION, 3611 NON_BOOL_NEGATION_EXPRESSION,
3676 NON_TYPE_AS_TYPE_ARGUMENT, 3612 NON_TYPE_AS_TYPE_ARGUMENT,
3677 RETURN_OF_INVALID_TYPE, 3613 RETURN_OF_INVALID_TYPE,
3678 TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 3614 TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
3679 TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 3615 TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
3680 UNDEFINED_GETTER, 3616 UNDEFINED_GETTER,
3681 UNDEFINED_METHOD, 3617 UNDEFINED_METHOD,
3682 UNDEFINED_OPERATOR, 3618 UNDEFINED_OPERATOR,
3683 UNDEFINED_SETTER, 3619 UNDEFINED_SETTER,
3684 UNDEFINED_SUPER_METHOD, 3620 UNDEFINED_SUPER_METHOD,
3685 UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, 3621 UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
3686 WRONG_NUMBER_OF_TYPE_ARGUMENTS]; 3622 WRONG_NUMBER_OF_TYPE_ARGUMENTS];
3687 3623
3688 /** 3624 /**
3689 * The template used to create the message to be displayed for this error. 3625 * The template used to create the message to be displayed for this error.
3690 */ 3626 */
3691 String message; 3627 final String message;
3692 3628
3693 /** 3629 /**
3694 * The template used to create the correction to be displayed for this error, or `null` if 3630 * The template used to create the correction to be displayed for this error, or `null` if
3695 * there is no correction information for this error. 3631 * there is no correction information for this error.
3696 */ 3632 */
3697 String correction6; 3633 final String correction;
3698 3634
3699 /** 3635 /**
3700 * Initialize a newly created error code to have the given message. 3636 * Initialize a newly created error code to have the given message.
3701 * 3637 *
3702 * @param message the message template used to create the message to be displa yed for the error 3638 * @param message the message template used to create the message to be displa yed for the error
3703 */ 3639 */
3704 StaticTypeWarningCode.con1(String name, int ordinal, String message) : super(n ame, ordinal) { 3640 const StaticTypeWarningCode.con1(String name, int ordinal, String message) : t his.con2(name, ordinal, message, null);
3705 this.message = message;
3706 }
3707 3641
3708 /** 3642 /**
3709 * Initialize a newly created error code to have the given message and correct ion. 3643 * Initialize a newly created error code to have the given message and correct ion.
3710 * 3644 *
3711 * @param message the template used to create the message to be displayed for the error 3645 * @param message the template used to create the message to be displayed for the error
3712 * @param correction the template used to create the correction to be displaye d for the error 3646 * @param correction the template used to create the correction to be displaye d for the error
3713 */ 3647 */
3714 StaticTypeWarningCode.con2(String name, int ordinal, String message, String co rrection) : super(name, ordinal) { 3648 const StaticTypeWarningCode.con2(String name, int ordinal, this.message, this. correction) : super(name, ordinal);
3715 this.message = message;
3716 this.correction6 = correction;
3717 }
3718
3719 @override
3720 String get correction => correction6;
3721 3649
3722 @override 3650 @override
3723 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; 3651 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
3724 3652
3725 @override 3653 @override
3726 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; 3654 ErrorType get type => ErrorType.STATIC_TYPE_WARNING;
3727 } 3655 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698