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

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

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

Powered by Google App Engine
This is Rietveld 408576698