| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 |
| 3 library engine.error; | 4 library engine.error; |
| 5 |
| 4 import 'java_core.dart'; | 6 import 'java_core.dart'; |
| 5 import 'source.dart'; | 7 import 'source.dart'; |
| 8 import 'scanner.dart' show Token; |
| 6 import 'ast.dart' show ASTNode; | 9 import 'ast.dart' show ASTNode; |
| 7 import 'scanner.dart' show Token; | 10 import 'element.dart' show Element; |
| 11 |
| 8 /** | 12 /** |
| 9 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er
rorCode] | 13 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er
rorCode] |
| 10 * . | 14 * . |
| 11 * | 15 * |
| 12 * @coverage dart.engine.error | 16 * @coverage dart.engine.error |
| 13 */ | 17 */ |
| 14 class ErrorSeverity extends Enum<ErrorSeverity> { | 18 class ErrorSeverity extends Enum<ErrorSeverity> { |
| 15 | |
| 16 /** | 19 /** |
| 17 * The severity representing a non-error. This is never used for any error cod
e, but is useful for | 20 * The severity representing a non-error. This is never used for any error cod
e, but is useful for |
| 18 * clients. | 21 * clients. |
| 19 */ | 22 */ |
| 20 static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none"); | 23 static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none"); |
| 21 | 24 |
| 22 /** | 25 /** |
| 23 * The severity representing an informational level analysis issue. | 26 * The severity representing an informational level analysis issue. |
| 24 */ | 27 */ |
| 25 static final ErrorSeverity INFO = new ErrorSeverity('INFO', 1, "I", "info"); | 28 static final ErrorSeverity INFO = new ErrorSeverity('INFO', 1, "I", "info"); |
| 26 | 29 |
| 27 /** | 30 /** |
| 28 * The severity representing a warning. Warnings can become errors if the `-We
rror` command | 31 * The severity representing a warning. Warnings can become errors if the `-We
rror` command |
| 29 * line flag is specified. | 32 * line flag is specified. |
| 30 */ | 33 */ |
| 31 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "war
ning"); | 34 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "war
ning"); |
| 32 | 35 |
| 33 /** | 36 /** |
| 34 * The severity representing an error. | 37 * The severity representing an error. |
| 35 */ | 38 */ |
| 36 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 3, "E", "error")
; | 39 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 3, "E", "error")
; |
| 40 |
| 37 static final List<ErrorSeverity> values = [NONE, INFO, WARNING, ERROR]; | 41 static final List<ErrorSeverity> values = [NONE, INFO, WARNING, ERROR]; |
| 38 | 42 |
| 39 /** | 43 /** |
| 40 * The name of the severity used when producing machine output. | 44 * The name of the severity used when producing machine output. |
| 41 */ | 45 */ |
| 42 String machineCode; | 46 String machineCode; |
| 43 | 47 |
| 44 /** | 48 /** |
| 45 * The name of the severity used when producing readable output. | 49 * The name of the severity used when producing readable output. |
| 46 */ | 50 */ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 } | 62 } |
| 59 | 63 |
| 60 /** | 64 /** |
| 61 * Return the severity constant that represents the greatest severity. | 65 * Return the severity constant that represents the greatest severity. |
| 62 * | 66 * |
| 63 * @param severity the severity being compared against | 67 * @param severity the severity being compared against |
| 64 * @return the most sever of this or the given severity | 68 * @return the most sever of this or the given severity |
| 65 */ | 69 */ |
| 66 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal
? this : severity; | 70 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal
? this : severity; |
| 67 } | 71 } |
| 72 |
| 68 /** | 73 /** |
| 69 * Instances of the class `AnalysisErrorWithProperties` | 74 * Instances of the class `AnalysisErrorWithProperties` |
| 70 */ | 75 */ |
| 71 class AnalysisErrorWithProperties extends AnalysisError { | 76 class AnalysisErrorWithProperties extends AnalysisError { |
| 72 | |
| 73 /** | 77 /** |
| 74 * The properties associated with this error. | 78 * The properties associated with this error. |
| 75 */ | 79 */ |
| 76 Map<ErrorProperty, Object> _propertyMap = new Map<ErrorProperty, Object>(); | 80 Map<ErrorProperty, Object> _propertyMap = new Map<ErrorProperty, Object>(); |
| 77 | 81 |
| 78 /** | 82 /** |
| 79 * Initialize a newly created analysis error for the specified source. The err
or has no location | 83 * Initialize a newly created analysis error for the specified source. The err
or has no location |
| 80 * information. | 84 * information. |
| 81 * | 85 * |
| 82 * @param source the source for which the exception occurred | 86 * @param source the source for which the exception occurred |
| 83 * @param errorCode the error code to be associated with this error | 87 * @param errorCode the error code to be associated with this error |
| 84 * @param arguments the arguments used to build the error message | 88 * @param arguments the arguments used to build the error message |
| 85 */ | 89 */ |
| 86 AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode, List<Obje
ct> arguments) : super.con1(source, errorCode, arguments); | 90 AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode, List<Obje
ct> arguments) : super.con1(source, errorCode, arguments); |
| 87 | 91 |
| 88 /** | 92 /** |
| 89 * Initialize a newly created analysis error for the specified source at the g
iven location. | 93 * Initialize a newly created analysis error for the specified source at the g
iven location. |
| 90 * | 94 * |
| 91 * @param source the source for which the exception occurred | 95 * @param source the source for which the exception occurred |
| 92 * @param offset the offset of the location of the error | 96 * @param offset the offset of the location of the error |
| 93 * @param length the length of the location of the error | 97 * @param length the length of the location of the error |
| 94 * @param errorCode the error code to be associated with this error | 98 * @param errorCode the error code to be associated with this error |
| 95 * @param arguments the arguments used to build the error message | 99 * @param arguments the arguments used to build the error message |
| 96 */ | 100 */ |
| 97 AnalysisErrorWithProperties.con2(Source source, int offset, int length, ErrorC
ode errorCode, List<Object> arguments) : super.con2(source, offset, length, erro
rCode, arguments); | 101 AnalysisErrorWithProperties.con2(Source source, int offset, int length, ErrorC
ode errorCode, List<Object> arguments) : super.con2(source, offset, length, erro
rCode, arguments); |
| 102 |
| 98 Object getProperty(ErrorProperty property) => _propertyMap[property]; | 103 Object getProperty(ErrorProperty property) => _propertyMap[property]; |
| 99 | 104 |
| 100 /** | 105 /** |
| 101 * Set the value of the given property to the given value. Using a value of `n
ull` will | 106 * Set the value of the given property to the given value. Using a value of `n
ull` will |
| 102 * effectively remove the property from this error. | 107 * effectively remove the property from this error. |
| 103 * | 108 * |
| 104 * @param property the property whose value is to be returned | 109 * @param property the property whose value is to be returned |
| 105 * @param value the new value of the given property | 110 * @param value the new value of the given property |
| 106 */ | 111 */ |
| 107 void setProperty(ErrorProperty property, Object value) { | 112 void setProperty(ErrorProperty property, Object value) { |
| 108 _propertyMap[property] = value; | 113 _propertyMap[property] = value; |
| 109 } | 114 } |
| 110 } | 115 } |
| 116 |
| 111 /** | 117 /** |
| 112 * Instances of the class `ErrorReporter` wrap an error listener with utility me
thods used to | 118 * Instances of the class `ErrorReporter` wrap an error listener with utility me
thods used to |
| 113 * create the errors being reported. | 119 * create the errors being reported. |
| 114 * | 120 * |
| 115 * @coverage dart.engine.error | 121 * @coverage dart.engine.error |
| 116 */ | 122 */ |
| 117 class ErrorReporter { | 123 class ErrorReporter { |
| 118 | |
| 119 /** | 124 /** |
| 120 * The error listener to which errors will be reported. | 125 * The error listener to which errors will be reported. |
| 121 */ | 126 */ |
| 122 AnalysisErrorListener _errorListener; | 127 AnalysisErrorListener _errorListener; |
| 123 | 128 |
| 124 /** | 129 /** |
| 125 * The default source to be used when reporting errors. | 130 * The default source to be used when reporting errors. |
| 126 */ | 131 */ |
| 127 Source _defaultSource; | 132 Source _defaultSource; |
| 128 | 133 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 172 } |
| 168 | 173 |
| 169 /** | 174 /** |
| 170 * Report an error with the given error code and arguments. | 175 * Report an error with the given error code and arguments. |
| 171 * | 176 * |
| 172 * @param errorCode the error code of the error to be reported | 177 * @param errorCode the error code of the error to be reported |
| 173 * @param node the node specifying the location of the error | 178 * @param node the node specifying the location of the error |
| 174 * @param arguments the arguments to the error, used to compose the error mess
age | 179 * @param arguments the arguments to the error, used to compose the error mess
age |
| 175 */ | 180 */ |
| 176 void reportError2(ErrorCode errorCode, ASTNode node, List<Object> arguments) { | 181 void reportError2(ErrorCode errorCode, ASTNode node, List<Object> arguments) { |
| 177 reportError3(errorCode, node.offset, node.length, arguments); | 182 reportError4(errorCode, node.offset, node.length, arguments); |
| 178 } | 183 } |
| 179 | 184 |
| 180 /** | 185 /** |
| 186 * Report an error with the given error code and arguments. |
| 187 * |
| 188 * @param errorCode the error code of the error to be reported |
| 189 * @param element the element which name should be used as the location of the
error |
| 190 * @param arguments the arguments to the error, used to compose the error mess
age |
| 191 */ |
| 192 void reportError3(ErrorCode errorCode, Element element, List<Object> arguments
) { |
| 193 reportError4(errorCode, element.nameOffset, element.displayName.length, argu
ments); |
| 194 } |
| 195 |
| 196 /** |
| 181 * Report an error with the given error code and arguments. | 197 * Report an error with the given error code and arguments. |
| 182 * | 198 * |
| 183 * @param errorCode the error code of the error to be reported | 199 * @param errorCode the error code of the error to be reported |
| 184 * @param offset the offset of the location of the error | 200 * @param offset the offset of the location of the error |
| 185 * @param length the length of the location of the error | 201 * @param length the length of the location of the error |
| 186 * @param arguments the arguments to the error, used to compose the error mess
age | 202 * @param arguments the arguments to the error, used to compose the error mess
age |
| 187 */ | 203 */ |
| 188 void reportError3(ErrorCode errorCode, int offset, int length, List<Object> ar
guments) { | 204 void reportError4(ErrorCode errorCode, int offset, int length, List<Object> ar
guments) { |
| 189 _errorListener.onError(new AnalysisError.con2(_source, offset, length, error
Code, arguments)); | 205 _errorListener.onError(new AnalysisError.con2(_source, offset, length, error
Code, arguments)); |
| 190 } | 206 } |
| 191 | 207 |
| 192 /** | 208 /** |
| 193 * Report an error with the given error code and arguments. | 209 * Report an error with the given error code and arguments. |
| 194 * | 210 * |
| 195 * @param errorCode the error code of the error to be reported | 211 * @param errorCode the error code of the error to be reported |
| 196 * @param token the token specifying the location of the error | 212 * @param token the token specifying the location of the error |
| 197 * @param arguments the arguments to the error, used to compose the error mess
age | 213 * @param arguments the arguments to the error, used to compose the error mess
age |
| 198 */ | 214 */ |
| 199 void reportError4(ErrorCode errorCode, Token token, List<Object> arguments) { | 215 void reportError5(ErrorCode errorCode, Token token, List<Object> arguments) { |
| 200 reportError3(errorCode, token.offset, token.length, arguments); | 216 reportError4(errorCode, token.offset, token.length, arguments); |
| 201 } | 217 } |
| 202 | 218 |
| 203 /** | 219 /** |
| 204 * Set the source to be used when reporting errors. Setting the source to `nul
l` will cause | 220 * Set the source to be used when reporting errors. Setting the source to `nul
l` will cause |
| 205 * the default source to be used. | 221 * the default source to be used. |
| 206 * | 222 * |
| 207 * @param source the source to be used when reporting errors | 223 * @param source the source to be used when reporting errors |
| 208 */ | 224 */ |
| 209 void set source(Source source) { | 225 void set source(Source source) { |
| 210 this._source = source == null ? _defaultSource : source; | 226 this._source = source == null ? _defaultSource : source; |
| 211 } | 227 } |
| 212 } | 228 } |
| 229 |
| 213 /** | 230 /** |
| 214 * Instances of the class `AnalysisError` represent an error discovered during t
he analysis of | 231 * Instances of the class `AnalysisError` represent an error discovered during t
he analysis of |
| 215 * some Dart code. | 232 * some Dart code. |
| 216 * | 233 * |
| 217 * @see AnalysisErrorListener | 234 * @see AnalysisErrorListener |
| 218 * @coverage dart.engine.error | 235 * @coverage dart.engine.error |
| 219 */ | 236 */ |
| 220 class AnalysisError { | 237 class AnalysisError { |
| 221 | |
| 222 /** | 238 /** |
| 223 * An empty array of errors used when no errors are expected. | 239 * An empty array of errors used when no errors are expected. |
| 224 */ | 240 */ |
| 225 static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0); | 241 static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0); |
| 226 | 242 |
| 227 /** | 243 /** |
| 228 * A [Comparator] that sorts by the name of the file that the [AnalysisError]
was | 244 * A [Comparator] that sorts by the name of the file that the [AnalysisError]
was |
| 229 * found. | 245 * found. |
| 230 */ | 246 */ |
| 231 static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1, Analysis
Error o2) => o1.source.shortName.compareTo(o2.source.shortName); | 247 static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1, Analysis
Error o2) => o1.source.shortName.compareTo(o2.source.shortName); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 this.source = source; | 329 this.source = source; |
| 314 this.offset = offset; | 330 this.offset = offset; |
| 315 this.length = length; | 331 this.length = length; |
| 316 this.errorCode = errorCode; | 332 this.errorCode = errorCode; |
| 317 this.message = JavaString.format(errorCode.message, arguments); | 333 this.message = JavaString.format(errorCode.message, arguments); |
| 318 String correctionTemplate = errorCode.correction; | 334 String correctionTemplate = errorCode.correction; |
| 319 if (correctionTemplate != null) { | 335 if (correctionTemplate != null) { |
| 320 this.correction = JavaString.format(correctionTemplate, arguments); | 336 this.correction = JavaString.format(correctionTemplate, arguments); |
| 321 } | 337 } |
| 322 } | 338 } |
| 339 |
| 323 bool operator ==(Object obj) { | 340 bool operator ==(Object obj) { |
| 324 if (identical(obj, this)) { | 341 if (identical(obj, this)) { |
| 325 return true; | 342 return true; |
| 326 } | 343 } |
| 327 if (obj is! AnalysisError) { | 344 if (obj is! AnalysisError) { |
| 328 return false; | 345 return false; |
| 329 } | 346 } |
| 330 AnalysisError other = obj as AnalysisError; | 347 AnalysisError other = obj as AnalysisError; |
| 331 if (errorCode != other.errorCode) { | 348 if (errorCode != other.errorCode) { |
| 332 return false; | 349 return false; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 347 } | 364 } |
| 348 | 365 |
| 349 /** | 366 /** |
| 350 * Return the value of the given property, or `null` if the given property is
not defined | 367 * Return the value of the given property, or `null` if the given property is
not defined |
| 351 * for this error. | 368 * for this error. |
| 352 * | 369 * |
| 353 * @param property the property whose value is to be returned | 370 * @param property the property whose value is to be returned |
| 354 * @return the value of the given property | 371 * @return the value of the given property |
| 355 */ | 372 */ |
| 356 Object getProperty(ErrorProperty property) => null; | 373 Object getProperty(ErrorProperty property) => null; |
| 374 |
| 357 int get hashCode { | 375 int get hashCode { |
| 358 int hashCode = offset; | 376 int hashCode = offset; |
| 359 hashCode ^= (message != null) ? message.hashCode : 0; | 377 hashCode ^= (message != null) ? message.hashCode : 0; |
| 360 hashCode ^= (source != null) ? source.hashCode : 0; | 378 hashCode ^= (source != null) ? source.hashCode : 0; |
| 361 return hashCode; | 379 return hashCode; |
| 362 } | 380 } |
| 381 |
| 363 String toString() { | 382 String toString() { |
| 364 JavaStringBuilder builder = new JavaStringBuilder(); | 383 JavaStringBuilder builder = new JavaStringBuilder(); |
| 365 builder.append((source != null) ? source.fullName : "<unknown source>"); | 384 builder.append((source != null) ? source.fullName : "<unknown source>"); |
| 366 builder.append("("); | 385 builder.append("("); |
| 367 builder.append(offset); | 386 builder.append(offset); |
| 368 builder.append(".."); | 387 builder.append(".."); |
| 369 builder.append(offset + length - 1); | 388 builder.append(offset + length - 1); |
| 370 builder.append("): "); | 389 builder.append("): "); |
| 371 builder.append(message); | 390 builder.append(message); |
| 372 return builder.toString(); | 391 return builder.toString(); |
| 373 } | 392 } |
| 374 } | 393 } |
| 394 |
| 375 /** | 395 /** |
| 376 * The enumeration `ErrorProperty` defines the properties that can be associated
with an | 396 * The enumeration `ErrorProperty` defines the properties that can be associated
with an |
| 377 * [AnalysisError]. | 397 * [AnalysisError]. |
| 378 */ | 398 */ |
| 379 class ErrorProperty extends Enum<ErrorProperty> { | 399 class ErrorProperty extends Enum<ErrorProperty> { |
| 380 | |
| 381 /** | 400 /** |
| 382 * A property whose value is an array of [ExecutableElement] that should | 401 * A property whose value is an array of [ExecutableElement] that should |
| 383 * be but are not implemented by a concrete class. | 402 * be but are not implemented by a concrete class. |
| 384 */ | 403 */ |
| 385 static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEM
ENTED_METHODS', 0); | 404 static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEM
ENTED_METHODS', 0); |
| 405 |
| 386 static final List<ErrorProperty> values = [UNIMPLEMENTED_METHODS]; | 406 static final List<ErrorProperty> values = [UNIMPLEMENTED_METHODS]; |
| 407 |
| 387 ErrorProperty(String name, int ordinal) : super(name, ordinal); | 408 ErrorProperty(String name, int ordinal) : super(name, ordinal); |
| 388 } | 409 } |
| 410 |
| 389 /** | 411 /** |
| 390 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. | 412 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. |
| 391 */ | 413 */ |
| 392 class TodoCode extends Enum<TodoCode> implements ErrorCode { | 414 class TodoCode extends Enum<TodoCode> implements ErrorCode { |
| 393 | |
| 394 /** | 415 /** |
| 395 * The single enum of TodoCode. | 416 * The single enum of TodoCode. |
| 396 */ | 417 */ |
| 397 static final TodoCode TODO = new TodoCode('TODO', 0); | 418 static final TodoCode TODO = new TodoCode('TODO', 0); |
| 419 |
| 398 static final List<TodoCode> values = [TODO]; | 420 static final List<TodoCode> values = [TODO]; |
| 399 | 421 |
| 400 /** | 422 /** |
| 401 * This matches the two common Dart task styles | 423 * This matches the two common Dart task styles |
| 402 * | 424 * |
| 403 * * TODO: | 425 * * TODO: |
| 404 * * TODO(username): | 426 * * TODO(username): |
| 405 * | 427 * |
| 406 * As well as | 428 * As well as |
| 407 * * TODO | 429 * * TODO |
| 408 * | 430 * |
| 409 * But not | 431 * But not |
| 410 * * todo | 432 * * todo |
| 411 * * TODOS | 433 * * TODOS |
| 412 */ | 434 */ |
| 413 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(
TODO:?\$))"); | 435 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(
TODO:?\$))"); |
| 436 |
| 414 TodoCode(String name, int ordinal) : super(name, ordinal); | 437 TodoCode(String name, int ordinal) : super(name, ordinal); |
| 438 |
| 415 String get correction => null; | 439 String get correction => null; |
| 440 |
| 416 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 441 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
| 442 |
| 417 String get message => "%s"; | 443 String get message => "%s"; |
| 444 |
| 418 ErrorType get type => ErrorType.TODO; | 445 ErrorType get type => ErrorType.TODO; |
| 419 } | 446 } |
| 447 |
| 420 /** | 448 /** |
| 421 * The enumeration `HintCode` defines the hints and coding recommendations for b
est practices | 449 * The enumeration `HintCode` defines the hints and coding recommendations for b
est practices |
| 422 * which are not mentioned in the Dart Language Specification. | 450 * which are not mentioned in the Dart Language Specification. |
| 423 */ | 451 */ |
| 424 class HintCode extends Enum<HintCode> implements ErrorCode { | 452 class HintCode extends Enum<HintCode> implements ErrorCode { |
| 425 | |
| 426 /** | 453 /** |
| 427 * Dead code is code that is never reached, this can happen for instance if a
statement follows a | 454 * Dead code is code that is never reached, this can happen for instance if a
statement follows a |
| 428 * return statement. | 455 * return statement. |
| 429 */ | 456 */ |
| 430 static final HintCode DEAD_CODE = new HintCode.con1('DEAD_CODE', 0, "Dead code
"); | 457 static final HintCode DEAD_CODE = new HintCode.con1('DEAD_CODE', 0, "Dead code
"); |
| 431 | 458 |
| 432 /** | 459 /** |
| 433 * Dead code is code that is never reached. This case covers cases where the u
ser has catch | 460 * Dead code is code that is never reached. This case covers cases where the u
ser has catch |
| 434 * clauses after `catch (e)` or `on Object catch (e)`. | 461 * clauses after `catch (e)` or `on Object catch (e)`. |
| 435 */ | 462 */ |
| 436 static final HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = new HintCode.con1('DEA
D_CODE_CATCH_FOLLOWING_CATCH', 1, "Dead code, catch clauses after a 'catch (e)'
or an 'on Object catch (e)' are never reached"); | 463 static final HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = new HintCode.con1('DEA
D_CODE_CATCH_FOLLOWING_CATCH', 1, "Dead code, catch clauses after a 'catch (e)'
or an 'on Object catch (e)' are never reached"); |
| 437 | 464 |
| 438 /** | 465 /** |
| 439 * Dead code is code that is never reached. This case covers cases where the u
ser has an on-catch | 466 * Dead code is code that is never reached. This case covers cases where the u
ser has an on-catch |
| 440 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh
t. | 467 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh
t. |
| 441 * | 468 * |
| 442 * @param subtypeName name of the subtype | 469 * @param subtypeName name of the subtype |
| 443 * @param supertypeName name of the supertype | 470 * @param supertypeName name of the supertype |
| 444 */ | 471 */ |
| 445 static final HintCode DEAD_CODE_ON_CATCH_SUBTYPE = new HintCode.con1('DEAD_COD
E_ON_CATCH_SUBTYPE', 2, "Dead code, this on-catch block will never be executed s
ince '%s' is a subtype of '%s'"); | 472 static final HintCode DEAD_CODE_ON_CATCH_SUBTYPE = new HintCode.con1('DEAD_COD
E_ON_CATCH_SUBTYPE', 2, "Dead code, this on-catch block will never be executed s
ince '%s' is a subtype of '%s'"); |
| 446 | 473 |
| 447 /** | 474 /** |
| 475 * Deprecated members should not be invoked or used. |
| 476 * |
| 477 * @param memberName the name of the member |
| 478 */ |
| 479 static final HintCode DEPRECATED_MEMBER_USE = new HintCode.con1('DEPRECATED_ME
MBER_USE', 3, "'%s' is deprecated"); |
| 480 |
| 481 /** |
| 448 * Duplicate imports. | 482 * Duplicate imports. |
| 449 */ | 483 */ |
| 450 static final HintCode DUPLICATE_IMPORT = new HintCode.con1('DUPLICATE_IMPORT',
3, "Duplicate import"); | 484 static final HintCode DUPLICATE_IMPORT = new HintCode.con1('DUPLICATE_IMPORT',
4, "Duplicate import"); |
| 451 | 485 |
| 452 /** | 486 /** |
| 453 * Hint to use the ~/ operator. | 487 * Hint to use the ~/ operator. |
| 454 */ | 488 */ |
| 455 static final HintCode DIVISION_OPTIMIZATION = new HintCode.con1('DIVISION_OPTI
MIZATION', 4, "The operator x ~/ y is more efficient than (x / y).toInt()"); | 489 static final HintCode DIVISION_OPTIMIZATION = new HintCode.con1('DIVISION_OPTI
MIZATION', 5, "The operator x ~/ y is more efficient than (x / y).toInt()"); |
| 456 | 490 |
| 457 /** | 491 /** |
| 458 * Hint for the `x is double` type checks. | 492 * Hint for the `x is double` type checks. |
| 459 */ | 493 */ |
| 460 static final HintCode IS_DOUBLE = new HintCode.con1('IS_DOUBLE', 5, "When comp
iled to JS, this test might return true when the left hand side is an int"); | 494 static final HintCode IS_DOUBLE = new HintCode.con1('IS_DOUBLE', 6, "When comp
iled to JS, this test might return true when the left hand side is an int"); |
| 461 | 495 |
| 462 /** | 496 /** |
| 463 * Hint for the `x is int` type checks. | 497 * Hint for the `x is int` type checks. |
| 464 */ | 498 */ |
| 465 static final HintCode IS_INT = new HintCode.con1('IS_INT', 6, "When compiled t
o JS, this test might return true when the left hand side is a double"); | 499 static final HintCode IS_INT = new HintCode.con1('IS_INT', 7, "When compiled t
o JS, this test might return true when the left hand side is a double"); |
| 466 | 500 |
| 467 /** | 501 /** |
| 468 * Hint for the `x is! double` type checks. | 502 * Hint for the `x is! double` type checks. |
| 469 */ | 503 */ |
| 470 static final HintCode IS_NOT_DOUBLE = new HintCode.con1('IS_NOT_DOUBLE', 7, "W
hen compiled to JS, this test might return false when the left hand side is an i
nt"); | 504 static final HintCode IS_NOT_DOUBLE = new HintCode.con1('IS_NOT_DOUBLE', 8, "W
hen compiled to JS, this test might return false when the left hand side is an i
nt"); |
| 471 | 505 |
| 472 /** | 506 /** |
| 473 * Hint for the `x is! int` type checks. | 507 * Hint for the `x is! int` type checks. |
| 474 */ | 508 */ |
| 475 static final HintCode IS_NOT_INT = new HintCode.con1('IS_NOT_INT', 8, "When co
mpiled to JS, this test might return false when the left hand side is a double")
; | 509 static final HintCode IS_NOT_INT = new HintCode.con1('IS_NOT_INT', 9, "When co
mpiled to JS, this test might return false when the left hand side is a double")
; |
| 476 | 510 |
| 477 /** | 511 /** |
| 478 * It is not in best practice to declare a private method that happens to over
ride the method in a | 512 * It is not in best practice to declare a private method that happens to over
ride the method in a |
| 479 * superclass- depending on where the superclass is (either in the same librar
y, or out of the | 513 * superclass- depending on where the superclass is (either in the same librar
y, or out of the |
| 480 * same library), behavior can be different. | 514 * same library), behavior can be different. |
| 481 * | 515 * |
| 482 * @param memberType this is either "method", "getter" or "setter" | 516 * @param memberType this is either "method", "getter" or "setter" |
| 483 * @param memberName some private member name | 517 * @param memberName some private member name |
| 484 * @param className the class name where the member is overriding the function
ality | 518 * @param className the class name where the member is overriding the function
ality |
| 485 */ | 519 */ |
| 486 static final HintCode OVERRIDDING_PRIVATE_MEMBER = new HintCode.con1('OVERRIDD
ING_PRIVATE_MEMBER', 9, "The %s '%s' does not override the definition from '%s'
because it is private and in a different library"); | 520 static final HintCode OVERRIDDING_PRIVATE_MEMBER = new HintCode.con1('OVERRIDD
ING_PRIVATE_MEMBER', 10, "The %s '%s' does not override the definition from '%s'
because it is private and in a different library"); |
| 487 | 521 |
| 488 /** | 522 /** |
| 489 * Hint for classes that override equals, but not hashCode. | 523 * Hint for classes that override equals, but not hashCode. |
| 490 * | 524 * |
| 491 * @param className the name of the current class | 525 * @param className the name of the current class |
| 492 */ | 526 */ |
| 493 static final HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = new HintCode.con1('O
VERRIDE_EQUALS_BUT_NOT_HASH_CODE', 10, "The class '%s' overrides 'operator==', b
ut not 'get hashCode'"); | 527 static final HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = new HintCode.con1('O
VERRIDE_EQUALS_BUT_NOT_HASH_CODE', 11, "The class '%s' overrides 'operator==', b
ut not 'get hashCode'"); |
| 494 | 528 |
| 495 /** | 529 /** |
| 496 * Type checks of the type `x is! Null` should be done with `x != null`. | 530 * Type checks of the type `x is! Null` should be done with `x != null`. |
| 497 */ | 531 */ |
| 498 static final HintCode TYPE_CHECK_IS_NOT_NULL = new HintCode.con1('TYPE_CHECK_I
S_NOT_NULL', 11, "Tests for non-null should be done with '!= null'"); | 532 static final HintCode TYPE_CHECK_IS_NOT_NULL = new HintCode.con1('TYPE_CHECK_I
S_NOT_NULL', 12, "Tests for non-null should be done with '!= null'"); |
| 499 | 533 |
| 500 /** | 534 /** |
| 501 * Type checks of the type `x is Null` should be done with `x == null`. | 535 * Type checks of the type `x is Null` should be done with `x == null`. |
| 502 */ | 536 */ |
| 503 static final HintCode TYPE_CHECK_IS_NULL = new HintCode.con1('TYPE_CHECK_IS_NU
LL', 12, "Tests for null should be done with '== null'"); | 537 static final HintCode TYPE_CHECK_IS_NULL = new HintCode.con1('TYPE_CHECK_IS_NU
LL', 13, "Tests for null should be done with '== null'"); |
| 504 | 538 |
| 505 /** | 539 /** |
| 506 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
GETTER] or | 540 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
GETTER] or |
| 507 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used
propagated | 541 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used
propagated |
| 508 * information for the warnings. | 542 * information for the warnings. |
| 509 * | 543 * |
| 510 * @param getterName the name of the getter | 544 * @param getterName the name of the getter |
| 511 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for | 545 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for |
| 512 * @see StaticTypeWarningCode#UNDEFINED_GETTER | 546 * @see StaticTypeWarningCode#UNDEFINED_GETTER |
| 513 * @see StaticWarningCode#UNDEFINED_GETTER | 547 * @see StaticWarningCode#UNDEFINED_GETTER |
| 514 */ | 548 */ |
| 515 static final HintCode UNDEFINED_GETTER = new HintCode.con1('UNDEFINED_GETTER',
13, StaticTypeWarningCode.UNDEFINED_GETTER.message); | 549 static final HintCode UNDEFINED_GETTER = new HintCode.con1('UNDEFINED_GETTER',
14, StaticTypeWarningCode.UNDEFINED_GETTER.message); |
| 516 | 550 |
| 517 /** | 551 /** |
| 518 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
METHOD] would | 552 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
METHOD] would |
| 519 * have been generated, if we used propagated information for the warnings. | 553 * have been generated, if we used propagated information for the warnings. |
| 520 * | 554 * |
| 521 * @param methodName the name of the method that is undefined | 555 * @param methodName the name of the method that is undefined |
| 522 * @param typeName the resolved type name that the method lookup is happening
on | 556 * @param typeName the resolved type name that the method lookup is happening
on |
| 523 * @see StaticTypeWarningCode#UNDEFINED_METHOD | 557 * @see StaticTypeWarningCode#UNDEFINED_METHOD |
| 524 */ | 558 */ |
| 525 static final HintCode UNDEFINED_METHOD = new HintCode.con1('UNDEFINED_METHOD',
14, StaticTypeWarningCode.UNDEFINED_METHOD.message); | 559 static final HintCode UNDEFINED_METHOD = new HintCode.con1('UNDEFINED_METHOD',
15, StaticTypeWarningCode.UNDEFINED_METHOD.message); |
| 526 | 560 |
| 527 /** | 561 /** |
| 528 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
OPERATOR] | 562 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
OPERATOR] |
| 529 * would have been generated, if we used propagated information for the warnin
gs. | 563 * would have been generated, if we used propagated information for the warnin
gs. |
| 530 * | 564 * |
| 531 * @param operator the name of the operator | 565 * @param operator the name of the operator |
| 532 * @param enclosingType the name of the enclosing type where the operator is b
eing looked for | 566 * @param enclosingType the name of the enclosing type where the operator is b
eing looked for |
| 533 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR | 567 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR |
| 534 */ | 568 */ |
| 535 static final HintCode UNDEFINED_OPERATOR = new HintCode.con1('UNDEFINED_OPERAT
OR', 15, StaticTypeWarningCode.UNDEFINED_OPERATOR.message); | 569 static final HintCode UNDEFINED_OPERATOR = new HintCode.con1('UNDEFINED_OPERAT
OR', 16, StaticTypeWarningCode.UNDEFINED_OPERATOR.message); |
| 536 | 570 |
| 537 /** | 571 /** |
| 538 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
SETTER] or | 572 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
SETTER] or |
| 539 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used
propagated | 573 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used
propagated |
| 540 * information for the warnings. | 574 * information for the warnings. |
| 541 * | 575 * |
| 542 * @param setterName the name of the setter | 576 * @param setterName the name of the setter |
| 543 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for | 577 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for |
| 544 * @see StaticTypeWarningCode#UNDEFINED_SETTER | 578 * @see StaticTypeWarningCode#UNDEFINED_SETTER |
| 545 * @see StaticWarningCode#UNDEFINED_SETTER | 579 * @see StaticWarningCode#UNDEFINED_SETTER |
| 546 */ | 580 */ |
| 547 static final HintCode UNDEFINED_SETTER = new HintCode.con1('UNDEFINED_SETTER',
16, StaticTypeWarningCode.UNDEFINED_SETTER.message); | 581 static final HintCode UNDEFINED_SETTER = new HintCode.con1('UNDEFINED_SETTER',
17, StaticTypeWarningCode.UNDEFINED_SETTER.message); |
| 548 | 582 |
| 549 /** | 583 /** |
| 550 * Unnecessary cast. | 584 * Unnecessary cast. |
| 551 */ | 585 */ |
| 552 static final HintCode UNNECESSARY_CAST = new HintCode.con1('UNNECESSARY_CAST',
17, "Unnecessary cast"); | 586 static final HintCode UNNECESSARY_CAST = new HintCode.con1('UNNECESSARY_CAST',
18, "Unnecessary cast"); |
| 553 | 587 |
| 554 /** | 588 /** |
| 555 * Unnecessary type checks, the result is always true. | 589 * Unnecessary type checks, the result is always true. |
| 556 */ | 590 */ |
| 557 static final HintCode UNNECESSARY_TYPE_CHECK_FALSE = new HintCode.con1('UNNECE
SSARY_TYPE_CHECK_FALSE', 18, "Unnecessary type check, the result is always false
"); | 591 static final HintCode UNNECESSARY_TYPE_CHECK_FALSE = new HintCode.con1('UNNECE
SSARY_TYPE_CHECK_FALSE', 19, "Unnecessary type check, the result is always false
"); |
| 558 | 592 |
| 559 /** | 593 /** |
| 560 * Unnecessary type checks, the result is always false. | 594 * Unnecessary type checks, the result is always false. |
| 561 */ | 595 */ |
| 562 static final HintCode UNNECESSARY_TYPE_CHECK_TRUE = new HintCode.con1('UNNECES
SARY_TYPE_CHECK_TRUE', 19, "Unnecessary type check, the result is always true"); | 596 static final HintCode UNNECESSARY_TYPE_CHECK_TRUE = new HintCode.con1('UNNECES
SARY_TYPE_CHECK_TRUE', 20, "Unnecessary type check, the result is always true"); |
| 563 | 597 |
| 564 /** | 598 /** |
| 565 * Unused imports are imports which are never not used. | 599 * Unused imports are imports which are never not used. |
| 566 */ | 600 */ |
| 567 static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 20, "
Unused import"); | 601 static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 21, "
Unused import"); |
| 602 |
| 568 static final List<HintCode> values = [ | 603 static final List<HintCode> values = [ |
| 569 DEAD_CODE, | 604 DEAD_CODE, |
| 570 DEAD_CODE_CATCH_FOLLOWING_CATCH, | 605 DEAD_CODE_CATCH_FOLLOWING_CATCH, |
| 571 DEAD_CODE_ON_CATCH_SUBTYPE, | 606 DEAD_CODE_ON_CATCH_SUBTYPE, |
| 607 DEPRECATED_MEMBER_USE, |
| 572 DUPLICATE_IMPORT, | 608 DUPLICATE_IMPORT, |
| 573 DIVISION_OPTIMIZATION, | 609 DIVISION_OPTIMIZATION, |
| 574 IS_DOUBLE, | 610 IS_DOUBLE, |
| 575 IS_INT, | 611 IS_INT, |
| 576 IS_NOT_DOUBLE, | 612 IS_NOT_DOUBLE, |
| 577 IS_NOT_INT, | 613 IS_NOT_INT, |
| 578 OVERRIDDING_PRIVATE_MEMBER, | 614 OVERRIDDING_PRIVATE_MEMBER, |
| 579 OVERRIDE_EQUALS_BUT_NOT_HASH_CODE, | 615 OVERRIDE_EQUALS_BUT_NOT_HASH_CODE, |
| 580 TYPE_CHECK_IS_NOT_NULL, | 616 TYPE_CHECK_IS_NOT_NULL, |
| 581 TYPE_CHECK_IS_NULL, | 617 TYPE_CHECK_IS_NULL, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 611 /** | 647 /** |
| 612 * Initialize a newly created error code to have the given message and correct
ion. | 648 * Initialize a newly created error code to have the given message and correct
ion. |
| 613 * | 649 * |
| 614 * @param message the template used to create the message to be displayed for
the error | 650 * @param message the template used to create the message to be displayed for
the error |
| 615 * @param correction the template used to create the correction to be displaye
d for the error | 651 * @param correction the template used to create the correction to be displaye
d for the error |
| 616 */ | 652 */ |
| 617 HintCode.con2(String name, int ordinal, String message, String correction) : s
uper(name, ordinal) { | 653 HintCode.con2(String name, int ordinal, String message, String correction) : s
uper(name, ordinal) { |
| 618 this._message = message; | 654 this._message = message; |
| 619 this.correction3 = correction; | 655 this.correction3 = correction; |
| 620 } | 656 } |
| 657 |
| 621 String get correction => correction3; | 658 String get correction => correction3; |
| 659 |
| 622 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; | 660 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; |
| 661 |
| 623 String get message => _message; | 662 String get message => _message; |
| 663 |
| 624 ErrorType get type => ErrorType.HINT; | 664 ErrorType get type => ErrorType.HINT; |
| 625 } | 665 } |
| 666 |
| 626 /** | 667 /** |
| 627 * The interface `ErrorCode` defines the behavior common to objects representing
error codes | 668 * The interface `ErrorCode` defines the behavior common to objects representing
error codes |
| 628 * associated with [AnalysisError]. | 669 * associated with [AnalysisError]. |
| 629 * | 670 * |
| 630 * Generally, we want to provide messages that consist of three sentences: 1. wh
at is wrong, 2. why | 671 * Generally, we want to provide messages that consist of three sentences: 1. wh
at is wrong, 2. why |
| 631 * is it wrong, and 3. how do I fix it. However, we combine the first two in the
result of | 672 * is it wrong, and 3. how do I fix it. However, we combine the first two in the
result of |
| 632 * [getMessage] and the last in the result of [getCorrection]. | 673 * [getMessage] and the last in the result of [getCorrection]. |
| 633 * | 674 * |
| 634 * @coverage dart.engine.error | 675 * @coverage dart.engine.error |
| 635 */ | 676 */ |
| 636 abstract class ErrorCode { | 677 abstract class ErrorCode { |
| 637 | |
| 638 /** | 678 /** |
| 639 * Return the template used to create the correction to be displayed for this
error, or | 679 * Return the template used to create the correction to be displayed for this
error, or |
| 640 * `null` if there is no correction information for this error. The correction
should | 680 * `null` if there is no correction information for this error. The correction
should |
| 641 * indicate how the user can fix the error. | 681 * indicate how the user can fix the error. |
| 642 * | 682 * |
| 643 * @return the template used to create the correction to be displayed for this
error | 683 * @return the template used to create the correction to be displayed for this
error |
| 644 */ | 684 */ |
| 645 String get correction; | 685 String get correction; |
| 646 | 686 |
| 647 /** | 687 /** |
| (...skipping 11 matching lines...) Expand all Loading... |
| 659 */ | 699 */ |
| 660 String get message; | 700 String get message; |
| 661 | 701 |
| 662 /** | 702 /** |
| 663 * Return the type of the error. | 703 * Return the type of the error. |
| 664 * | 704 * |
| 665 * @return the type of the error | 705 * @return the type of the error |
| 666 */ | 706 */ |
| 667 ErrorType get type; | 707 ErrorType get type; |
| 668 } | 708 } |
| 709 |
| 669 /** | 710 /** |
| 670 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode]
. | 711 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode]
. |
| 671 * | 712 * |
| 672 * @coverage dart.engine.error | 713 * @coverage dart.engine.error |
| 673 */ | 714 */ |
| 674 class ErrorType extends Enum<ErrorType> { | 715 class ErrorType extends Enum<ErrorType> { |
| 675 | |
| 676 /** | 716 /** |
| 677 * Task (todo) comments in user code. | 717 * Task (todo) comments in user code. |
| 678 */ | 718 */ |
| 679 static final ErrorType TODO = new ErrorType('TODO', 0, ErrorSeverity.INFO); | 719 static final ErrorType TODO = new ErrorType('TODO', 0, ErrorSeverity.INFO); |
| 680 | 720 |
| 681 /** | 721 /** |
| 682 * Extra analysis run over the code to follow best practices, which are not in
the Dart Language | 722 * Extra analysis run over the code to follow best practices, which are not in
the Dart Language |
| 683 * Specification. | 723 * Specification. |
| 684 */ | 724 */ |
| 685 static final ErrorType HINT = new ErrorType('HINT', 1, ErrorSeverity.INFO); | 725 static final ErrorType HINT = new ErrorType('HINT', 1, ErrorSeverity.INFO); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 705 /** | 745 /** |
| 706 * Many, but not all, static warnings relate to types, in which case they are
known as static type | 746 * Many, but not all, static warnings relate to types, in which case they are
known as static type |
| 707 * warnings. | 747 * warnings. |
| 708 */ | 748 */ |
| 709 static final ErrorType STATIC_TYPE_WARNING = new ErrorType('STATIC_TYPE_WARNIN
G', 5, ErrorSeverity.WARNING); | 749 static final ErrorType STATIC_TYPE_WARNING = new ErrorType('STATIC_TYPE_WARNIN
G', 5, ErrorSeverity.WARNING); |
| 710 | 750 |
| 711 /** | 751 /** |
| 712 * Syntactic errors are errors produced as a result of input that does not con
form to the grammar. | 752 * Syntactic errors are errors produced as a result of input that does not con
form to the grammar. |
| 713 */ | 753 */ |
| 714 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 6, E
rrorSeverity.ERROR); | 754 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 6, E
rrorSeverity.ERROR); |
| 755 |
| 715 static final List<ErrorType> values = [ | 756 static final List<ErrorType> values = [ |
| 716 TODO, | 757 TODO, |
| 717 HINT, | 758 HINT, |
| 718 COMPILE_TIME_ERROR, | 759 COMPILE_TIME_ERROR, |
| 719 PUB_SUGGESTION, | 760 PUB_SUGGESTION, |
| 720 STATIC_WARNING, | 761 STATIC_WARNING, |
| 721 STATIC_TYPE_WARNING, | 762 STATIC_TYPE_WARNING, |
| 722 SYNTACTIC_ERROR]; | 763 SYNTACTIC_ERROR]; |
| 723 | 764 |
| 724 /** | 765 /** |
| 725 * The severity of this type of error. | 766 * The severity of this type of error. |
| 726 */ | 767 */ |
| 727 ErrorSeverity severity; | 768 ErrorSeverity severity; |
| 728 | 769 |
| 729 /** | 770 /** |
| 730 * Initialize a newly created error type to have the given severity. | 771 * Initialize a newly created error type to have the given severity. |
| 731 * | 772 * |
| 732 * @param severity the severity of this type of error | 773 * @param severity the severity of this type of error |
| 733 */ | 774 */ |
| 734 ErrorType(String name, int ordinal, ErrorSeverity severity) : super(name, ordi
nal) { | 775 ErrorType(String name, int ordinal, ErrorSeverity severity) : super(name, ordi
nal) { |
| 735 this.severity = severity; | 776 this.severity = severity; |
| 736 } | 777 } |
| 778 |
| 737 String get displayName => name.toLowerCase().replaceAll('_', ' '); | 779 String get displayName => name.toLowerCase().replaceAll('_', ' '); |
| 738 } | 780 } |
| 781 |
| 739 /** | 782 /** |
| 740 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi
le time | 783 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi
le time |
| 741 * errors. The convention for this class is for the name of the error code to in
dicate the problem | 784 * errors. The convention for this class is for the name of the error code to in
dicate the problem |
| 742 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | 785 * that caused the error to be generated and for the error message to explain wh
at is wrong and, |
| 743 * when appropriate, how the problem can be corrected. | 786 * when appropriate, how the problem can be corrected. |
| 744 * | 787 * |
| 745 * @coverage dart.engine.error | 788 * @coverage dart.engine.error |
| 746 */ | 789 */ |
| 747 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
de { | 790 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
de { |
| 748 | |
| 749 /** | 791 /** |
| 750 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
by a library | 792 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
by a library |
| 751 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b
y more than one | 793 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b
y more than one |
| 752 * export. | 794 * export, unless each all exports refer to same declaration for the name N. |
| 753 * | 795 * |
| 754 * @param ambiguousElementName the name of the ambiguous element | 796 * @param ambiguousElementName the name of the ambiguous element |
| 755 * @param firstLibraryName the name of the first library that the type is foun
d | 797 * @param firstLibraryName the name of the first library that the type is foun
d |
| 756 * @param secondLibraryName the name of the second library that the type is fo
und | 798 * @param secondLibraryName the name of the second library that the type is fo
und |
| 757 */ | 799 */ |
| 758 static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode.
con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' a
nd '%s'"); | 800 static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode.
con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' a
nd '%s'"); |
| 759 | 801 |
| 760 /** | 802 /** |
| 761 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
not denote a formal | 803 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
not denote a formal |
| 762 * parameter. | 804 * parameter. |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 * | 1945 * |
| 1904 * @param actualNumberOfParameters the number of parameters found in the opera
tor declaration | 1946 * @param actualNumberOfParameters the number of parameters found in the opera
tor declaration |
| 1905 */ | 1947 */ |
| 1906 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"); | 1948 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"); |
| 1907 | 1949 |
| 1908 /** | 1950 /** |
| 1909 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
does not include | 1951 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
does not include |
| 1910 * exactly one required formal parameter <i>p</i>. | 1952 * exactly one required formal parameter <i>p</i>. |
| 1911 */ | 1953 */ |
| 1912 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"); | 1954 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"); |
| 1955 |
| 1913 static final List<CompileTimeErrorCode> values = [ | 1956 static final List<CompileTimeErrorCode> values = [ |
| 1914 AMBIGUOUS_EXPORT, | 1957 AMBIGUOUS_EXPORT, |
| 1915 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, | 1958 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, |
| 1916 BUILT_IN_IDENTIFIER_AS_TYPE, | 1959 BUILT_IN_IDENTIFIER_AS_TYPE, |
| 1917 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, | 1960 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, |
| 1918 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, | 1961 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, |
| 1919 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, | 1962 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, |
| 1920 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, | 1963 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, |
| 1921 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, | 1964 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, |
| 1922 CONFLICTING_GETTER_AND_METHOD, | 1965 CONFLICTING_GETTER_AND_METHOD, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 /** | 2118 /** |
| 2076 * Initialize a newly created error code to have the given message and correct
ion. | 2119 * Initialize a newly created error code to have the given message and correct
ion. |
| 2077 * | 2120 * |
| 2078 * @param message the template used to create the message to be displayed for
the error | 2121 * @param message the template used to create the message to be displayed for
the error |
| 2079 * @param correction the template used to create the correction to be displaye
d for the error | 2122 * @param correction the template used to create the correction to be displaye
d for the error |
| 2080 */ | 2123 */ |
| 2081 CompileTimeErrorCode.con2(String name, int ordinal, String message, String cor
rection) : super(name, ordinal) { | 2124 CompileTimeErrorCode.con2(String name, int ordinal, String message, String cor
rection) : super(name, ordinal) { |
| 2082 this._message = message; | 2125 this._message = message; |
| 2083 this.correction2 = correction; | 2126 this.correction2 = correction; |
| 2084 } | 2127 } |
| 2128 |
| 2085 String get correction => correction2; | 2129 String get correction => correction2; |
| 2130 |
| 2086 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; | 2131 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; |
| 2132 |
| 2087 String get message => _message; | 2133 String get message => _message; |
| 2134 |
| 2088 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; | 2135 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; |
| 2089 } | 2136 } |
| 2137 |
| 2090 /** | 2138 /** |
| 2091 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin
g deviations | 2139 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin
g deviations |
| 2092 * from pub best practices. The convention for this class is for the name of the
bad practice to | 2140 * from pub best practices. The convention for this class is for the name of the
bad practice to |
| 2093 * indicate the problem that caused the suggestion to be generated and for the m
essage to explain | 2141 * indicate the problem that caused the suggestion to be generated and for the m
essage to explain |
| 2094 * what is wrong and, when appropriate, how the situation can be corrected. | 2142 * what is wrong and, when appropriate, how the situation can be corrected. |
| 2095 */ | 2143 */ |
| 2096 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { | 2144 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { |
| 2097 | |
| 2098 /** | 2145 /** |
| 2099 * It is a bad practice for a source file in a package "lib" directory hierarc
hy to traverse | 2146 * It is a bad practice for a source file in a package "lib" directory hierarc
hy to traverse |
| 2100 * outside that directory hierarchy. For example, a source file in the "lib" d
irectory should not | 2147 * outside that directory hierarchy. For example, a source file in the "lib" d
irectory should not |
| 2101 * contain a directive such as `import '../web/some.dart'` which references a
file outside | 2148 * contain a directive such as `import '../web/some.dart'` which references a
file outside |
| 2102 * the lib directory. | 2149 * the lib directory. |
| 2103 */ | 2150 */ |
| 2104 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"); | 2151 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"); |
| 2105 | 2152 |
| 2106 /** | 2153 /** |
| 2107 * It is a bad practice for a source file ouside a package "lib" directory hie
rarchy to traverse | 2154 * It is a bad practice for a source file ouside a package "lib" directory hie
rarchy to traverse |
| 2108 * into that directory hierarchy. For example, a source file in the "web" dire
ctory should not | 2155 * into that directory hierarchy. For example, a source file in the "web" dire
ctory should not |
| 2109 * contain a directive such as `import '../lib/some.dart'` which references a
file inside | 2156 * contain a directive such as `import '../lib/some.dart'` which references a
file inside |
| 2110 * the lib directory. | 2157 * the lib directory. |
| 2111 */ | 2158 */ |
| 2112 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."); | 2159 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."); |
| 2113 | 2160 |
| 2114 /** | 2161 /** |
| 2115 * It is a bad practice for a package import to reference anything outside the
given package, or | 2162 * It is a bad practice for a package import to reference anything outside the
given package, or |
| 2116 * more generally, it is bad practice for a package import to contain a "..".
For example, a | 2163 * more generally, it is bad practice for a package import to contain a "..".
For example, a |
| 2117 * source file should not contain a directive such as `import 'package:foo/../
some.dart'`. | 2164 * source file should not contain a directive such as `import 'package:foo/../
some.dart'`. |
| 2118 */ | 2165 */ |
| 2119 static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSugges
tionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not
contain '..'"); | 2166 static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSugges
tionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not
contain '..'"); |
| 2167 |
| 2120 static final List<PubSuggestionCode> values = [ | 2168 static final List<PubSuggestionCode> values = [ |
| 2121 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, | 2169 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, |
| 2122 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, | 2170 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, |
| 2123 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; | 2171 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; |
| 2124 | 2172 |
| 2125 /** | 2173 /** |
| 2126 * The template used to create the message to be displayed for this error. | 2174 * The template used to create the message to be displayed for this error. |
| 2127 */ | 2175 */ |
| 2128 String _message; | 2176 String _message; |
| 2129 | 2177 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2145 /** | 2193 /** |
| 2146 * Initialize a newly created error code to have the given message and correct
ion. | 2194 * Initialize a newly created error code to have the given message and correct
ion. |
| 2147 * | 2195 * |
| 2148 * @param message the template used to create the message to be displayed for
the error | 2196 * @param message the template used to create the message to be displayed for
the error |
| 2149 * @param correction the template used to create the correction to be displaye
d for the error | 2197 * @param correction the template used to create the correction to be displaye
d for the error |
| 2150 */ | 2198 */ |
| 2151 PubSuggestionCode.con2(String name, int ordinal, String message, String correc
tion) : super(name, ordinal) { | 2199 PubSuggestionCode.con2(String name, int ordinal, String message, String correc
tion) : super(name, ordinal) { |
| 2152 this._message = message; | 2200 this._message = message; |
| 2153 this.correction5 = correction; | 2201 this.correction5 = correction; |
| 2154 } | 2202 } |
| 2203 |
| 2155 String get correction => correction5; | 2204 String get correction => correction5; |
| 2205 |
| 2156 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity; | 2206 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity; |
| 2207 |
| 2157 String get message => _message; | 2208 String get message => _message; |
| 2209 |
| 2158 ErrorType get type => ErrorType.PUB_SUGGESTION; | 2210 ErrorType get type => ErrorType.PUB_SUGGESTION; |
| 2159 } | 2211 } |
| 2212 |
| 2160 /** | 2213 /** |
| 2161 * The enumeration `StaticWarningCode` defines the error codes used for static w
arnings. The | 2214 * The enumeration `StaticWarningCode` defines the error codes used for static w
arnings. The |
| 2162 * convention for this class is for the name of the error code to indicate the p
roblem that caused | 2215 * convention for this class is for the name of the error code to indicate the p
roblem that caused |
| 2163 * the error to be generated and for the error message to explain what is wrong
and, when | 2216 * the error to be generated and for the error message to explain what is wrong
and, when |
| 2164 * appropriate, how the problem can be corrected. | 2217 * appropriate, how the problem can be corrected. |
| 2165 * | 2218 * |
| 2166 * @coverage dart.engine.error | 2219 * @coverage dart.engine.error |
| 2167 */ | 2220 */ |
| 2168 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode { | 2221 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode { |
| 2169 | |
| 2170 /** | 2222 /** |
| 2171 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i
>N</i> is introduced | 2223 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i
>N</i> is introduced |
| 2172 * into the top level scope <i>L</i> by more than one import then: | 2224 * into the top level scope <i>L</i> by more than one import then: |
| 2173 * <ol> | 2225 * <ol> |
| 2174 * * A static warning occurs. | 2226 * * A static warning occurs. |
| 2175 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet
hodError</i> is | 2227 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet
hodError</i> is |
| 2176 * raised. | 2228 * raised. |
| 2177 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. | 2229 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. |
| 2178 * </ol> | 2230 * </ol> |
| 2179 * | 2231 * |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2264 /** | 2316 /** |
| 2265 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc
e getter named | 2317 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc
e getter named |
| 2266 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec
lared in a | 2318 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec
lared in a |
| 2267 * superclass of <i>C</i>. | 2319 * superclass of <i>C</i>. |
| 2268 * | 2320 * |
| 2269 * @param superName the name of the super class declaring a static member | 2321 * @param superName the name of the super class declaring a static member |
| 2270 */ | 2322 */ |
| 2271 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"); | 2323 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"); |
| 2272 | 2324 |
| 2273 /** | 2325 /** |
| 2326 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a
n instance method |
| 2327 * named <i>n</i> and has a setter named <i>n=</i>. |
| 2328 */ |
| 2329 static final StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = new Static
WarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 10, "Class '%s' declares
instance method %s and has a setter with the same name from '%s'"); |
| 2330 |
| 2331 /** |
| 2274 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc
e setter named | 2332 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc
e setter named |
| 2275 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de
clared in a | 2333 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de
clared in a |
| 2276 * superclass of <i>C</i>. | 2334 * superclass of <i>C</i>. |
| 2277 * | 2335 * |
| 2278 * @param superName the name of the super class declaring a static member | 2336 * @param superName the name of the super class declaring a static member |
| 2279 */ | 2337 */ |
| 2280 static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER', 10, "Superclass '%s' declares static member with the same name"); | 2338 static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER', 11, "Superclass '%s' declares static member with the same name"); |
| 2281 | 2339 |
| 2282 /** | 2340 /** |
| 2283 * 7.2 Getters: It is a static warning if a class declares a static getter nam
ed <i>v</i> and also | 2341 * 7.2 Getters: It is a static warning if a class declares a static getter nam
ed <i>v</i> and also |
| 2284 * has a non-static setter named <i>v=</i>. | 2342 * has a non-static setter named <i>v=</i>. |
| 2285 */ | 2343 */ |
| 2286 static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
new StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 11,
"Class '%s' declares non-static setter with the same name"); | 2344 static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
new StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 12,
"Class '%s' declares non-static setter with the same name"); |
| 2287 | 2345 |
| 2288 /** | 2346 /** |
| 2289 * 7.3 Setters: It is a static warning if a class declares a static setter nam
ed <i>v=</i> and | 2347 * 7.3 Setters: It is a static warning if a class declares a static setter nam
ed <i>v=</i> and |
| 2290 * also has a non-static member named <i>v</i>. | 2348 * also has a non-static member named <i>v</i>. |
| 2291 */ | 2349 */ |
| 2292 static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER =
new StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 12,
"Class '%s' declares non-static member with the same name"); | 2350 static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER =
new StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 13,
"Class '%s' declares non-static member with the same name"); |
| 2293 | 2351 |
| 2294 /** | 2352 /** |
| 2295 * 12.11.2 Const: Given an instance creation expression of the form <i>const q
(a<sub>1</sub>, | 2353 * 12.11.2 Const: Given an instance creation expression of the form <i>const q
(a<sub>1</sub>, |
| 2296 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const
ructor of an | 2354 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const
ructor of an |
| 2297 * abstract class but <i>q</i> is not a factory constructor. | 2355 * abstract class but <i>q</i> is not a factory constructor. |
| 2298 */ | 2356 */ |
| 2299 static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCo
de.con1('CONST_WITH_ABSTRACT_CLASS', 13, "Abstract classes cannot be created wit
h a 'const' expression"); | 2357 static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCo
de.con1('CONST_WITH_ABSTRACT_CLASS', 14, "Abstract classes cannot be created wit
h a 'const' expression"); |
| 2300 | 2358 |
| 2301 /** | 2359 /** |
| 2302 * 12.7 Maps: It is a static warning if the values of any two keys in a map li
teral are equal. | 2360 * 12.7 Maps: It is a static warning if the values of any two keys in a map li
teral are equal. |
| 2303 */ | 2361 */ |
| 2304 static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode.con1(
'EQUAL_KEYS_IN_MAP', 14, "Keys in a map cannot be equal"); | 2362 static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode.con1(
'EQUAL_KEYS_IN_MAP', 15, "Keys in a map cannot be equal"); |
| 2305 | 2363 |
| 2306 /** | 2364 /** |
| 2307 * 14.2 Exports: It is a static warning to export two different libraries with
the same name. | 2365 * 14.2 Exports: It is a static warning to export two different libraries with
the same name. |
| 2308 * | 2366 * |
| 2309 * @param uri1 the uri pointing to a first library | 2367 * @param uri1 the uri pointing to a first library |
| 2310 * @param uri2 the uri pointing to a second library | 2368 * @param uri2 the uri pointing to a second library |
| 2311 * @param name the shared name of the exported libraries | 2369 * @param name the shared name of the exported libraries |
| 2312 */ | 2370 */ |
| 2313 static final StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 15, "The exported libraries '%s'
and '%s' should not have the same name '%s'"); | 2371 static final StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 16, "The exported libraries '%s'
and '%s' should not have the same name '%s'"); |
| 2314 | 2372 |
| 2315 /** | 2373 /** |
| 2316 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > | 2374 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > |
| 2317 * n</i>. | 2375 * n</i>. |
| 2318 * | 2376 * |
| 2319 * @param requiredCount the maximum number of positional arguments | 2377 * @param requiredCount the maximum number of positional arguments |
| 2320 * @param argumentCount the actual number of positional arguments given | 2378 * @param argumentCount the actual number of positional arguments given |
| 2321 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS | 2379 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS |
| 2322 */ | 2380 */ |
| 2323 static final StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = new StaticWarningC
ode.con1('EXTRA_POSITIONAL_ARGUMENTS', 16, "%d positional arguments expected, bu
t %d found"); | 2381 static final StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = new StaticWarningC
ode.con1('EXTRA_POSITIONAL_ARGUMENTS', 17, "%d positional arguments expected, bu
t %d found"); |
| 2324 | 2382 |
| 2325 /** | 2383 /** |
| 2326 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at | 2384 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at |
| 2327 * its point of declaration is also initialized in a constructor. | 2385 * its point of declaration is also initialized in a constructor. |
| 2328 */ | 2386 */ |
| 2329 static final StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N = new StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
', 17, "Values cannot be set in the constructor if they are final, and have alre
ady been set"); | 2387 static final StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N = new StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
', 18, "Values cannot be set in the constructor if they are final, and have alre
ady been set"); |
| 2330 | 2388 |
| 2331 /** | 2389 /** |
| 2332 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at | 2390 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at |
| 2333 * its point of declaration is also initialized in a constructor. | 2391 * its point of declaration is also initialized in a constructor. |
| 2334 * | 2392 * |
| 2335 * @param name the name of the field in question | 2393 * @param name the name of the field in question |
| 2336 */ | 2394 */ |
| 2337 static final StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO
R = new StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
', 18, "'%s' is final and was given a value when it was declared, so it cannot b
e set to a new value"); | 2395 static final StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO
R = new StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
', 19, "'%s' is final and was given a value when it was declared, so it cannot b
e set to a new value"); |
| 2338 | 2396 |
| 2339 /** | 2397 /** |
| 2340 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t
his</b>.<i>v</i> = | 2398 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t
his</b>.<i>v</i> = |
| 2341 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t
o an object | 2399 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t
o an object |
| 2342 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi
s is bound to | 2400 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi
s is bound to |
| 2343 * <i>o</i>. | 2401 * <i>o</i>. |
| 2344 * | 2402 * |
| 2345 * 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 |
| 2346 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 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 <= i <= |
| 2347 * 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>. |
| 2348 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2406 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
| 2349 * j <= m</i>. | 2407 * j <= m</i>. |
| 2350 * | 2408 * |
| 2351 * @param initializerType the name of the type of the initializer expression | 2409 * @param initializerType the name of the type of the initializer expression |
| 2352 * @param fieldType the name of the type of the field | 2410 * @param fieldType the name of the type of the field |
| 2353 */ | 2411 */ |
| 2354 static final StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 19, "The initializer type '%s
' cannot be assigned to the field type '%s'"); | 2412 static final StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 20, "The initializer type '%s
' cannot be assigned to the field type '%s'"); |
| 2355 | 2413 |
| 2356 /** | 2414 /** |
| 2357 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a | 2415 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a |
| 2358 * static warning if the static type of <i>id</i> is not assignable to <i>T<su
b>id</sub></i>. | 2416 * static warning if the static type of <i>id</i> is not assignable to <i>T<su
b>id</sub></i>. |
| 2359 * | 2417 * |
| 2360 * @param parameterType the name of the type of the field formal parameter | 2418 * @param parameterType the name of the type of the field formal parameter |
| 2361 * @param fieldType the name of the type of the field | 2419 * @param fieldType the name of the type of the field |
| 2362 */ | 2420 */ |
| 2363 static final StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = new
StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 20, "The para
meter type '%s' is incompatable with the field type '%s'"); | 2421 static final StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = new
StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 21, "The para
meter type '%s' is incompatable with the field type '%s'"); |
| 2364 | 2422 |
| 2365 /** | 2423 /** |
| 2366 * 5 Variables: It is a static warning if a library, static or local variable
<i>v</i> is final | 2424 * 5 Variables: It is a static warning if a library, static or local variable
<i>v</i> is final |
| 2367 * and <i>v</i> is not initialized at its point of declaration. | 2425 * and <i>v</i> is not initialized at its point of declaration. |
| 2368 * | 2426 * |
| 2369 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar
ed in the | 2427 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar
ed in the |
| 2370 * immediately enclosing class must have an initializer in <i>k</i>'s initiali
zer list unless it | 2428 * immediately enclosing class must have an initializer in <i>k</i>'s initiali
zer list unless it |
| 2371 * has already been initialized by one of the following means: | 2429 * has already been initialized by one of the following means: |
| 2372 * | 2430 * |
| 2373 * * Initialization at the declaration of <i>f</i>. | 2431 * * Initialization at the declaration of <i>f</i>. |
| 2374 * * Initialization by means of an initializing formal of <i>k</i>. | 2432 * * Initialization by means of an initializing formal of <i>k</i>. |
| 2375 * | 2433 * |
| 2376 * or a static warning occurs. | 2434 * or a static warning occurs. |
| 2377 * | 2435 * |
| 2378 * @param name the name of the uninitialized final variable | 2436 * @param name the name of the uninitialized final variable |
| 2379 */ | 2437 */ |
| 2380 static final StaticWarningCode FINAL_NOT_INITIALIZED = new StaticWarningCode.c
on1('FINAL_NOT_INITIALIZED', 21, "The final variable '%s' must be initialized"); | 2438 static final StaticWarningCode FINAL_NOT_INITIALIZED = new StaticWarningCode.c
on1('FINAL_NOT_INITIALIZED', 22, "The final variable '%s' must be initialized"); |
| 2381 | 2439 |
| 2382 /** | 2440 /** |
| 2383 * 15.5 Function Types: It is a static warning if a concrete class implements
Function and does | 2441 * 15.5 Function Types: It is a static warning if a concrete class implements
Function and does |
| 2384 * not have a concrete method named call(). | 2442 * not have a concrete method named call(). |
| 2385 */ | 2443 */ |
| 2386 static final StaticWarningCode FUNCTION_WITHOUT_CALL = new StaticWarningCode.c
on1('FUNCTION_WITHOUT_CALL', 22, "Concrete classes that implement Function must
implement the method call()"); | 2444 static final StaticWarningCode FUNCTION_WITHOUT_CALL = new StaticWarningCode.c
on1('FUNCTION_WITHOUT_CALL', 23, "Concrete classes that implement Function must
implement the method call()"); |
| 2387 | 2445 |
| 2388 /** | 2446 /** |
| 2389 * 14.1 Imports: It is a static warning to import two different libraries with
the same name. | 2447 * 14.1 Imports: It is a static warning to import two different libraries with
the same name. |
| 2390 * | 2448 * |
| 2391 * @param uri1 the uri pointing to a first library | 2449 * @param uri1 the uri pointing to a first library |
| 2392 * @param uri2 the uri pointing to a second library | 2450 * @param uri2 the uri pointing to a second library |
| 2393 * @param name the shared name of the imported libraries | 2451 * @param name the shared name of the imported libraries |
| 2394 */ | 2452 */ |
| 2395 static final StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 23, "The imported libraries '%s'
and '%s' should not have the same name '%s'"); | 2453 static final StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 24, "The imported libraries '%s'
and '%s' should not have the same name '%s'"); |
| 2396 | 2454 |
| 2397 /** | 2455 /** |
| 2398 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, | 2456 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, |
| 2399 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because | 2457 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because |
| 2400 * identically named members existed in several superinterfaces) then at most
one member is | 2458 * identically named members existed in several superinterfaces) then at most
one member is |
| 2401 * inherited. | 2459 * inherited. |
| 2402 * | 2460 * |
| 2403 * If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i>, are get
ters, or if some but | 2461 * If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i>, are get
ters, or if some but |
| 2404 * not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</su
b></i> are | 2462 * not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</su
b></i> are |
| 2405 * inherited, and a static warning is issued. | 2463 * inherited, and a static warning is issued. |
| 2406 */ | 2464 */ |
| 2407 static final StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD = new StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD', 24, "'%s' is inherited as a getter and also a method"); | 2465 static final StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD = new StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD', 25, "'%s' is inherited as a getter and also a method"); |
| 2408 | 2466 |
| 2409 /** | 2467 /** |
| 2410 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a
n instance method | 2468 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a
n instance method |
| 2411 * named <i>n</i> and an accessible static member named <i>n</i> is declared i
n a superclass of | 2469 * named <i>n</i> and an accessible static member named <i>n</i> is declared i
n a superclass of |
| 2412 * <i>C</i>. | 2470 * <i>C</i>. |
| 2413 * | 2471 * |
| 2414 * @param memberName the name of the member with the name conflict | 2472 * @param memberName the name of the member with the name conflict |
| 2415 * @param superclassName the name of the enclosing class that has the static m
ember | 2473 * @param superclassName the name of the enclosing class that has the static m
ember |
| 2416 */ | 2474 */ |
| 2417 static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S
TATIC = new StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLAS
S_STATIC', 25, "'%s' collides with a static member in the superclass '%s'"); | 2475 static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S
TATIC = new StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLAS
S_STATIC', 26, "'%s' collides with a static member in the superclass '%s'"); |
| 2418 | 2476 |
| 2419 /** | 2477 /** |
| 2420 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette
r <i>m2</i> and the | 2478 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette
r <i>m2</i> and the |
| 2421 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 2479 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 2422 * | 2480 * |
| 2423 * @param actualReturnTypeName the name of the expected return type | 2481 * @param actualReturnTypeName the name of the expected return type |
| 2424 * @param expectedReturnType the name of the actual return type, not assignabl
e to the | 2482 * @param expectedReturnType the name of the actual return type, not assignabl
e to the |
| 2425 * actualReturnTypeName | 2483 * actualReturnTypeName |
| 2426 * @param className the name of the class where the overridden getter is decla
red | 2484 * @param className the name of the class where the overridden getter is decla
red |
| 2427 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE | 2485 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE |
| 2428 */ | 2486 */ |
| 2429 static final StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 26, "The return type '%
s' is not assignable to '%s' as required by the getter it is overriding from '%s
'"); | 2487 static final StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 27, "The return type '%
s' is not assignable to '%s' as required by the getter it is overriding from '%s
'"); |
| 2430 | 2488 |
| 2431 /** | 2489 /** |
| 2432 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2490 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2433 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2491 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
| 2434 * | 2492 * |
| 2435 * @param actualParamTypeName the name of the expected parameter type | 2493 * @param actualParamTypeName the name of the expected parameter type |
| 2436 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2494 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
| 2437 * actualParamTypeName | 2495 * actualParamTypeName |
| 2438 * @param className the name of the class where the overridden method is decla
red | 2496 * @param className the name of the class where the overridden method is decla
red |
| 2439 */ | 2497 */ |
| 2440 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 27, "The para
meter type '%s' is not assignable to '%s' as required by the method it is overri
ding from '%s'"); | 2498 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 28, "The para
meter type '%s' is not assignable to '%s' as required by the method it is overri
ding from '%s'"); |
| 2441 | 2499 |
| 2442 /** | 2500 /** |
| 2443 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2501 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2444 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2502 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
| 2445 * | 2503 * |
| 2446 * @param actualParamTypeName the name of the expected parameter type | 2504 * @param actualParamTypeName the name of the expected parameter type |
| 2447 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2505 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
| 2448 * actualParamTypeName | 2506 * actualParamTypeName |
| 2449 * @param className the name of the class where the overridden method is decla
red | 2507 * @param className the name of the class where the overridden method is decla
red |
| 2450 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE | 2508 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE |
| 2451 */ | 2509 */ |
| 2452 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 28, "The pa
rameter type '%s' is not assignable to '%s' as required by the method it is over
riding from '%s'"); | 2510 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 29, "The pa
rameter type '%s' is not assignable to '%s' as required by the method it is over
riding from '%s'"); |
| 2453 | 2511 |
| 2454 /** | 2512 /** |
| 2455 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2513 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2456 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2514 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
| 2457 * | 2515 * |
| 2458 * @param actualParamTypeName the name of the expected parameter type | 2516 * @param actualParamTypeName the name of the expected parameter type |
| 2459 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2517 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
| 2460 * actualParamTypeName | 2518 * actualParamTypeName |
| 2461 * @param className the name of the class where the overridden method is decla
red | 2519 * @param className the name of the class where the overridden method is decla
red |
| 2462 */ | 2520 */ |
| 2463 static final StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = n
ew StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 29, "Th
e parameter type '%s' is not assignable to '%s' as required by the method it is
overriding from '%s'"); | 2521 static final StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = n
ew StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 30, "Th
e parameter type '%s' is not assignable to '%s' as required by the method it is
overriding from '%s'"); |
| 2464 | 2522 |
| 2465 /** | 2523 /** |
| 2466 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2524 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2467 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2525 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
| 2468 * | 2526 * |
| 2469 * @param actualReturnTypeName the name of the expected return type | 2527 * @param actualReturnTypeName the name of the expected return type |
| 2470 * @param expectedReturnType the name of the actual return type, not assignabl
e to the | 2528 * @param expectedReturnType the name of the actual return type, not assignabl
e to the |
| 2471 * actualReturnTypeName | 2529 * actualReturnTypeName |
| 2472 * @param className the name of the class where the overridden method is decla
red | 2530 * @param className the name of the class where the overridden method is decla
red |
| 2473 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE | 2531 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE |
| 2474 */ | 2532 */ |
| 2475 static final StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 30, "The return type '%
s' is not assignable to '%s' as required by the method it is overriding from '%s
'"); | 2533 static final StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 31, "The return type '%
s' is not assignable to '%s' as required by the method it is overriding from '%s
'"); |
| 2476 | 2534 |
| 2477 /** | 2535 /** |
| 2478 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2536 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2479 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for | 2537 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for |
| 2480 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value | 2538 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value |
| 2481 * for <i>p</i>. | 2539 * for <i>p</i>. |
| 2482 */ | 2540 */ |
| 2483 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED
= new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED',
31, "Parameters cannot override default values, this method overrides '%s.%s' w
here '%s' has a different value"); | 2541 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED
= new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED',
32, "Parameters cannot override default values, this method overrides '%s.%s' w
here '%s' has a different value"); |
| 2484 | 2542 |
| 2485 /** | 2543 /** |
| 2486 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2544 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2487 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for | 2545 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for |
| 2488 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value | 2546 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value |
| 2489 * for <i>p</i>. | 2547 * for <i>p</i>. |
| 2490 */ | 2548 */ |
| 2491 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT
IONAL = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_PO
SITIONAL', 32, "Parameters cannot override default values, this method overrides
'%s.%s' where this positional parameter has a different value"); | 2549 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT
IONAL = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_PO
SITIONAL', 33, "Parameters cannot override default values, this method overrides
'%s.%s' where this positional parameter has a different value"); |
| 2492 | 2550 |
| 2493 /** | 2551 /** |
| 2494 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2552 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2495 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para
meters declared by | 2553 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para
meters declared by |
| 2496 * <i>m2</i>. | 2554 * <i>m2</i>. |
| 2497 * | 2555 * |
| 2498 * @param paramCount the number of named parameters in the overridden member | 2556 * @param paramCount the number of named parameters in the overridden member |
| 2499 * @param className the name of the class from the overridden method | 2557 * @param className the name of the class from the overridden method |
| 2500 */ | 2558 */ |
| 2501 static final StaticWarningCode INVALID_OVERRIDE_NAMED = new StaticWarningCode.
con1('INVALID_OVERRIDE_NAMED', 33, "Missing the named parameter '%s' to match th
e overridden method from '%s'"); | 2559 static final StaticWarningCode INVALID_OVERRIDE_NAMED = new StaticWarningCode.
con1('INVALID_OVERRIDE_NAMED', 34, "Missing the named parameter '%s' to match th
e overridden method from '%s'"); |
| 2502 | 2560 |
| 2503 /** | 2561 /** |
| 2504 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2562 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2505 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha
n <i>m2</i>. | 2563 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha
n <i>m2</i>. |
| 2506 * | 2564 * |
| 2507 * @param paramCount the number of positional parameters in the overridden mem
ber | 2565 * @param paramCount the number of positional parameters in the overridden mem
ber |
| 2508 * @param className the name of the class from the overridden method | 2566 * @param className the name of the class from the overridden method |
| 2509 */ | 2567 */ |
| 2510 static final StaticWarningCode INVALID_OVERRIDE_POSITIONAL = new StaticWarning
Code.con1('INVALID_OVERRIDE_POSITIONAL', 34, "Must have at least %d parameters t
o match the overridden method from '%s'"); | 2568 static final StaticWarningCode INVALID_OVERRIDE_POSITIONAL = new StaticWarning
Code.con1('INVALID_OVERRIDE_POSITIONAL', 35, "Must have at least %d parameters t
o match the overridden method from '%s'"); |
| 2511 | 2569 |
| 2512 /** | 2570 /** |
| 2513 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2571 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
| 2514 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa
rameters than | 2572 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa
rameters than |
| 2515 * <i>m2</i>. | 2573 * <i>m2</i>. |
| 2516 * | 2574 * |
| 2517 * @param paramCount the number of required parameters in the overridden membe
r | 2575 * @param paramCount the number of required parameters in the overridden membe
r |
| 2518 * @param className the name of the class from the overridden method | 2576 * @param className the name of the class from the overridden method |
| 2519 */ | 2577 */ |
| 2520 static final StaticWarningCode INVALID_OVERRIDE_REQUIRED = new StaticWarningCo
de.con1('INVALID_OVERRIDE_REQUIRED', 35, "Must have %d required parameters or le
ss to match the overridden method from '%s'"); | 2578 static final StaticWarningCode INVALID_OVERRIDE_REQUIRED = new StaticWarningCo
de.con1('INVALID_OVERRIDE_REQUIRED', 36, "Must have %d required parameters or le
ss to match the overridden method from '%s'"); |
| 2521 | 2579 |
| 2522 /** | 2580 /** |
| 2523 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette
r <i>m2</i> and the | 2581 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette
r <i>m2</i> and the |
| 2524 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 2582 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 2525 * | 2583 * |
| 2526 * @param actualParamTypeName the name of the expected parameter type | 2584 * @param actualParamTypeName the name of the expected parameter type |
| 2527 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2585 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
| 2528 * actualParamTypeName | 2586 * actualParamTypeName |
| 2529 * @param className the name of the class where the overridden setter is decla
red | 2587 * @param className the name of the class where the overridden setter is decla
red |
| 2530 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE | 2588 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE |
| 2531 */ | 2589 */ |
| 2532 static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 36, "The pa
rameter type '%s' is not assignable to '%s' as required by the setter it is over
riding from '%s'"); | 2590 static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 37, "The pa
rameter type '%s' is not assignable to '%s' as required by the setter it is over
riding from '%s'"); |
| 2533 | 2591 |
| 2534 /** | 2592 /** |
| 2535 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i>
... | 2593 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i>
... |
| 2536 * <i>e<sub>n</sub></i>] is evaluated as follows: | 2594 * <i>e<sub>n</sub></i>] is evaluated as follows: |
| 2537 * | 2595 * |
| 2538 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
second argument | 2596 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
second argument |
| 2539 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> | 2597 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> |
| 2540 * | 2598 * |
| 2541 * | 2599 * |
| 2542 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2600 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
| 2543 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2601 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
| 2544 * 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>. | 2602 * 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>. |
| 2545 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2603 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
| 2546 * j <= m</i>. | 2604 * j <= m</i>. |
| 2547 */ | 2605 */ |
| 2548 static final StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 37, "The element type '%s' ca
nnot be assigned to the list type '%s'"); | 2606 static final StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 38, "The element type '%s' ca
nnot be assigned to the list type '%s'"); |
| 2549 | 2607 |
| 2550 /** | 2608 /** |
| 2551 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : | 2609 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : |
| 2552 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: | 2610 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: |
| 2553 * | 2611 * |
| 2554 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second | 2612 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second |
| 2555 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 2613 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
| 2556 * | 2614 * |
| 2557 * | 2615 * |
| 2558 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2616 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
| 2559 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2617 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
| 2560 * 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>. | 2618 * 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>. |
| 2561 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2619 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
| 2562 * j <= m</i>. | 2620 * j <= m</i>. |
| 2563 */ | 2621 */ |
| 2564 static final StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new StaticWarning
Code.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 38, "The element type '%s' cannot be as
signed to the map key type '%s'"); | 2622 static final StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new StaticWarning
Code.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 39, "The element type '%s' cannot be as
signed to the map key type '%s'"); |
| 2565 | 2623 |
| 2566 /** | 2624 /** |
| 2567 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : | 2625 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : |
| 2568 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: | 2626 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: |
| 2569 * | 2627 * |
| 2570 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second | 2628 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second |
| 2571 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 2629 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
| 2572 * | 2630 * |
| 2573 * | 2631 * |
| 2574 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2632 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
| 2575 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2633 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
| 2576 * 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>. | 2634 * 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>. |
| 2577 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2635 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
| 2578 * j <= m</i>. | 2636 * j <= m</i>. |
| 2579 */ | 2637 */ |
| 2580 static final StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new StaticWarni
ngCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 39, "The element type '%s' cannot b
e assigned to the map value type '%s'"); | 2638 static final StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new StaticWarni
ngCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' cannot b
e assigned to the map value type '%s'"); |
| 2581 | 2639 |
| 2582 /** | 2640 /** |
| 2583 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type | 2641 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type |
| 2584 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be | 2642 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be |
| 2585 * assigned to <i>S</i>. | 2643 * assigned to <i>S</i>. |
| 2586 */ | 2644 */ |
| 2587 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new Static
WarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 40, "The parameter type f
or setter '%s' is '%s' which is not assignable to its getter (of type '%s')"); | 2645 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new Static
WarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 41, "The parameter type f
or setter '%s' is '%s' which is not assignable to its getter (of type '%s')"); |
| 2588 | 2646 |
| 2589 /** | 2647 /** |
| 2590 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type | 2648 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type |
| 2591 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be | 2649 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be |
| 2592 * assigned to <i>S</i>. | 2650 * assigned to <i>S</i>. |
| 2593 */ | 2651 */ |
| 2594 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY
PE = new StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY
PE', 41, "The parameter type for setter '%s' is '%s' which is not assignable to
its getter (of type '%s'), from superclass '%s'"); | 2652 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY
PE = new StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY
PE', 42, "The parameter type for setter '%s' is '%s' which is not assignable to
its getter (of type '%s'), from superclass '%s'"); |
| 2595 | 2653 |
| 2596 /** | 2654 /** |
| 2597 * 13.12 Return: It is a static warning if a function contains both one or mor
e return statements | 2655 * 13.12 Return: It is a static warning if a function contains both one or mor
e return statements |
| 2598 * of the form <i>return;</i> and one or more return statements of the form <i
>return e;</i>. | 2656 * of the form <i>return;</i> and one or more return statements of the form <i
>return e;</i>. |
| 2599 */ | 2657 */ |
| 2600 static final StaticWarningCode MIXED_RETURN_TYPES = new StaticWarningCode.con1
('MIXED_RETURN_TYPES', 42, "Methods and functions cannot use return both with an
d without values"); | 2658 static final StaticWarningCode MIXED_RETURN_TYPES = new StaticWarningCode.con1
('MIXED_RETURN_TYPES', 43, "Methods and functions cannot use return both with an
d without values"); |
| 2601 | 2659 |
| 2602 /** | 2660 /** |
| 2603 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst
ract class and | 2661 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst
ract class and |
| 2604 * <i>q</i> is not a factory constructor. | 2662 * <i>q</i> is not a factory constructor. |
| 2605 */ | 2663 */ |
| 2606 static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode
.con1('NEW_WITH_ABSTRACT_CLASS', 43, "Abstract classes cannot be created with a
'new' expression"); | 2664 static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode
.con1('NEW_WITH_ABSTRACT_CLASS', 44, "Abstract classes cannot be created with a
'new' expression"); |
| 2607 | 2665 |
| 2608 /** | 2666 /** |
| 2609 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat
ic warning. | 2667 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat
ic warning. |
| 2610 * | 2668 * |
| 2611 * @param typeName the name of the type being referenced (<i>S</i>) | 2669 * @param typeName the name of the type being referenced (<i>S</i>) |
| 2612 * @param parameterCount the number of type parameters that were declared | 2670 * @param parameterCount the number of type parameters that were declared |
| 2613 * @param argumentCount the number of type arguments provided | 2671 * @param argumentCount the number of type arguments provided |
| 2614 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS | 2672 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS |
| 2615 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS | 2673 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS |
| 2616 */ | 2674 */ |
| 2617 static final StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = new StaticWa
rningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 44, "The type '%s' is declare
d with %d type parameters, but %d type arguments were given"); | 2675 static final StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = new StaticWa
rningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 45, "The type '%s' is declare
d with %d type parameters, but %d type arguments were given"); |
| 2618 | 2676 |
| 2619 /** | 2677 /** |
| 2620 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i
n the current scope, | 2678 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i
n the current scope, |
| 2621 * optionally followed by type arguments. | 2679 * optionally followed by type arguments. |
| 2622 * | 2680 * |
| 2623 * @param name the name of the non-type element | 2681 * @param name the name of the non-type element |
| 2624 */ | 2682 */ |
| 2625 static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode.con1(
'NEW_WITH_NON_TYPE', 45, "The name '%s' is not a class"); | 2683 static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode.con1(
'NEW_WITH_NON_TYPE', 46, "The name '%s' is not a class"); |
| 2626 | 2684 |
| 2627 /** | 2685 /** |
| 2628 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: | 2686 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: |
| 2629 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, | 2687 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, |
| 2630 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | 2688 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a |
| 2631 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. | 2689 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. |
| 2632 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: | 2690 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: |
| 2633 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the | 2691 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the |
| 2634 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. | 2692 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. |
| 2635 */ | 2693 */ |
| 2636 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarn
ingCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 46, "The class '%s' does not have
a constructor '%s'"); | 2694 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarn
ingCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 47, "The class '%s' does not have
a constructor '%s'"); |
| 2637 | 2695 |
| 2638 /** | 2696 /** |
| 2639 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: | 2697 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: |
| 2640 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, | 2698 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, |
| 2641 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | 2699 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a |
| 2642 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. | 2700 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. |
| 2643 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: | 2701 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: |
| 2644 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the | 2702 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the |
| 2645 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. | 2703 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. |
| 2646 */ | 2704 */ |
| 2647 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new St
aticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 47, "The class '%
s' does not have a default constructor"); | 2705 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new St
aticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 48, "The class '%
s' does not have a default constructor"); |
| 2648 | 2706 |
| 2649 /** | 2707 /** |
| 2650 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2708 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
| 2651 * abstract method. | 2709 * abstract method. |
| 2652 * | 2710 * |
| 2653 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2711 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
| 2654 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2712 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
| 2655 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2713 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
| 2656 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2714 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
| 2657 * | 2715 * |
| 2658 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2716 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
| 2659 * inherited in a concrete class unless that member overrides a concrete one. | 2717 * inherited in a concrete class unless that member overrides a concrete one. |
| 2660 * | 2718 * |
| 2661 * @param memberName the name of the first member | 2719 * @param memberName the name of the first member |
| 2662 * @param memberName the name of the second member | 2720 * @param memberName the name of the second member |
| 2663 * @param memberName the name of the third member | 2721 * @param memberName the name of the third member |
| 2664 * @param memberName the name of the fourth member | 2722 * @param memberName the name of the fourth member |
| 2665 * @param additionalCount the number of additional missing members that aren't
listed | 2723 * @param additionalCount the number of additional missing members that aren't
listed |
| 2666 */ | 2724 */ |
| 2667 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV
E_PLUS = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER
_FIVE_PLUS', 48, "Missing inherited members: '%s', '%s', '%s', '%s' and %d more"
); | 2725 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV
E_PLUS = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER
_FIVE_PLUS', 49, "Missing inherited members: '%s', '%s', '%s', '%s' and %d more"
); |
| 2668 | 2726 |
| 2669 /** | 2727 /** |
| 2670 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2728 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
| 2671 * abstract method. | 2729 * abstract method. |
| 2672 * | 2730 * |
| 2673 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2731 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
| 2674 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2732 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
| 2675 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2733 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
| 2676 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2734 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
| 2677 * | 2735 * |
| 2678 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2736 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
| 2679 * inherited in a concrete class unless that member overrides a concrete one. | 2737 * inherited in a concrete class unless that member overrides a concrete one. |
| 2680 * | 2738 * |
| 2681 * @param memberName the name of the first member | 2739 * @param memberName the name of the first member |
| 2682 * @param memberName the name of the second member | 2740 * @param memberName the name of the second member |
| 2683 * @param memberName the name of the third member | 2741 * @param memberName the name of the third member |
| 2684 * @param memberName the name of the fourth member | 2742 * @param memberName the name of the fourth member |
| 2685 */ | 2743 */ |
| 2686 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU
R = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR
', 49, "Missing inherited members: '%s', '%s', '%s' and '%s'"); | 2744 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU
R = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR
', 50, "Missing inherited members: '%s', '%s', '%s' and '%s'"); |
| 2687 | 2745 |
| 2688 /** | 2746 /** |
| 2689 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2747 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
| 2690 * abstract method. | 2748 * abstract method. |
| 2691 * | 2749 * |
| 2692 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2750 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
| 2693 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2751 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
| 2694 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2752 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
| 2695 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2753 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
| 2696 * | 2754 * |
| 2697 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2755 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
| 2698 * inherited in a concrete class unless that member overrides a concrete one. | 2756 * inherited in a concrete class unless that member overrides a concrete one. |
| 2699 * | 2757 * |
| 2700 * @param memberName the name of the member | 2758 * @param memberName the name of the member |
| 2701 */ | 2759 */ |
| 2702 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
= new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE',
50, "Missing inherited member '%s'"); | 2760 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
= new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE',
51, "Missing inherited member '%s'"); |
| 2703 | 2761 |
| 2704 /** | 2762 /** |
| 2705 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2763 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
| 2706 * abstract method. | 2764 * abstract method. |
| 2707 * | 2765 * |
| 2708 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2766 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
| 2709 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2767 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
| 2710 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2768 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
| 2711 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2769 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
| 2712 * | 2770 * |
| 2713 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2771 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
| 2714 * inherited in a concrete class unless that member overrides a concrete one. | 2772 * inherited in a concrete class unless that member overrides a concrete one. |
| 2715 * | 2773 * |
| 2716 * @param memberName the name of the first member | 2774 * @param memberName the name of the first member |
| 2717 * @param memberName the name of the second member | 2775 * @param memberName the name of the second member |
| 2718 * @param memberName the name of the third member | 2776 * @param memberName the name of the third member |
| 2719 */ | 2777 */ |
| 2720 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE', 51, "Missing inherited members: '%s', '%s' and '%s'"); | 2778 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE', 52, "Missing inherited members: '%s', '%s' and '%s'"); |
| 2721 | 2779 |
| 2722 /** | 2780 /** |
| 2723 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2781 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
| 2724 * abstract method. | 2782 * abstract method. |
| 2725 * | 2783 * |
| 2726 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2784 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
| 2727 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2785 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
| 2728 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2786 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
| 2729 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2787 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
| 2730 * | 2788 * |
| 2731 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2789 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
| 2732 * inherited in a concrete class unless that member overrides a concrete one. | 2790 * inherited in a concrete class unless that member overrides a concrete one. |
| 2733 * | 2791 * |
| 2734 * @param memberName the name of the first member | 2792 * @param memberName the name of the first member |
| 2735 * @param memberName the name of the second member | 2793 * @param memberName the name of the second member |
| 2736 */ | 2794 */ |
| 2737 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
= new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO',
52, "Missing inherited members: '%s' and '%s'"); | 2795 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
= new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO',
53, "Missing inherited members: '%s' and '%s'"); |
| 2738 | 2796 |
| 2739 /** | 2797 /** |
| 2740 * 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 | 2798 * 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 |
| 2741 * <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 | 2799 * <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 |
| 2742 * is a static warning if <i>T</i> does not denote a type available in the lex
ical scope of the | 2800 * is a static warning if <i>T</i> does not denote a type available in the lex
ical scope of the |
| 2743 * catch clause. | 2801 * catch clause. |
| 2744 * | 2802 * |
| 2745 * @param name the name of the non-type element | 2803 * @param name the name of the non-type element |
| 2746 */ | 2804 */ |
| 2747 static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCod
e.con1('NON_TYPE_IN_CATCH_CLAUSE', 53, "The name '%s' is not a type and cannot b
e used in an on-catch clause"); | 2805 static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCod
e.con1('NON_TYPE_IN_CATCH_CLAUSE', 54, "The name '%s' is not a type and cannot b
e used in an on-catch clause"); |
| 2748 | 2806 |
| 2749 /** | 2807 /** |
| 2750 * 7.1.1 Operators: It is a static warning if the return type of the user-decl
ared operator []= is | 2808 * 7.1.1 Operators: It is a static warning if the return type of the user-decl
ared operator []= is |
| 2751 * explicitly declared and not void. | 2809 * explicitly declared and not void. |
| 2752 */ | 2810 */ |
| 2753 static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarnin
gCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 54, "The return type of the operator
[]= must be 'void'"); | 2811 static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarnin
gCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 55, "The return type of the operator
[]= must be 'void'"); |
| 2754 | 2812 |
| 2755 /** | 2813 /** |
| 2756 * 7.3 Setters: It is a static warning if a setter declares a return type othe
r than void. | 2814 * 7.3 Setters: It is a static warning if a setter declares a return type othe
r than void. |
| 2757 */ | 2815 */ |
| 2758 static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningC
ode.con1('NON_VOID_RETURN_FOR_SETTER', 55, "The return type of the setter must b
e 'void'"); | 2816 static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningC
ode.con1('NON_VOID_RETURN_FOR_SETTER', 56, "The return type of the setter must b
e 'void'"); |
| 2759 | 2817 |
| 2760 /** | 2818 /** |
| 2761 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for
m <i>id</i> or the | 2819 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for
m <i>id</i> or the |
| 2762 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</
i> (respectively | 2820 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</
i> (respectively |
| 2763 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet
er in the | 2821 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet
er in the |
| 2764 * enclosing lexical scope, but occurs in the signature or body of a static me
mber. * | 2822 * enclosing lexical scope, but occurs in the signature or body of a static me
mber. * |
| 2765 * <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<s
ub>n</sub>></i>, | 2823 * <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<s
ub>n</sub>></i>, |
| 2766 * and <i>G</i> is malformed. | 2824 * and <i>G</i> is malformed. |
| 2767 * | 2825 * |
| 2768 * Any use of a malformed type gives rise to a static warning. | 2826 * Any use of a malformed type gives rise to a static warning. |
| 2769 * | 2827 * |
| 2770 * @param nonTypeName the name that is not a type | 2828 * @param nonTypeName the name that is not a type |
| 2771 */ | 2829 */ |
| 2772 static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode.con1('NOT_A_
TYPE', 56, "%s is not a type"); | 2830 static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode.con1('NOT_A_
TYPE', 57, "%s is not a type"); |
| 2773 | 2831 |
| 2774 /** | 2832 /** |
| 2775 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > | 2833 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > |
| 2776 * n</i>. | 2834 * n</i>. |
| 2777 * | 2835 * |
| 2778 * @param requiredCount the expected number of required arguments | 2836 * @param requiredCount the expected number of required arguments |
| 2779 * @param argumentCount the actual number of positional arguments given | 2837 * @param argumentCount the actual number of positional arguments given |
| 2780 * @see #EXTRA_POSITIONAL_ARGUMENTS | 2838 * @see #EXTRA_POSITIONAL_ARGUMENTS |
| 2781 */ | 2839 */ |
| 2782 static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarni
ngCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 57, "%d required argument(s) expect
ed, but %d found"); | 2840 static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarni
ngCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 58, "%d required argument(s) expect
ed, but %d found"); |
| 2783 | 2841 |
| 2784 /** | 2842 /** |
| 2785 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p<
/i> names a library | 2843 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p<
/i> names a library |
| 2786 * other than the current library as the library to which <i>p</i> belongs. | 2844 * other than the current library as the library to which <i>p</i> belongs. |
| 2787 * | 2845 * |
| 2788 * @param expectedLibraryName the name of expected library name | 2846 * @param expectedLibraryName the name of expected library name |
| 2789 * @param actualLibraryName the non-matching actual library name from the "par
t of" declaration | 2847 * @param actualLibraryName the non-matching actual library name from the "par
t of" declaration |
| 2790 */ | 2848 */ |
| 2791 static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCo
de.con1('PART_OF_DIFFERENT_LIBRARY', 58, "Expected this library to be part of '%
s', not '%s'"); | 2849 static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCo
de.con1('PART_OF_DIFFERENT_LIBRARY', 59, "Expected this library to be part of '%
s', not '%s'"); |
| 2792 | 2850 |
| 2793 /** | 2851 /** |
| 2794 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of | 2852 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of |
| 2795 * the type of <i>k</i>. | 2853 * the type of <i>k</i>. |
| 2796 * | 2854 * |
| 2797 * @param redirectedName the name of the redirected constructor | 2855 * @param redirectedName the name of the redirected constructor |
| 2798 * @param redirectingName the name of the redirecting constructor | 2856 * @param redirectingName the name of the redirecting constructor |
| 2799 */ | 2857 */ |
| 2800 static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticW
arningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 59, "The redirected constru
ctor '%s' has incompatible parameters with '%s'"); | 2858 static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticW
arningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 60, "The redirected constru
ctor '%s' has incompatible parameters with '%s'"); |
| 2801 | 2859 |
| 2802 /** | 2860 /** |
| 2803 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of | 2861 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of |
| 2804 * the type of <i>k</i>. | 2862 * the type of <i>k</i>. |
| 2805 * | 2863 * |
| 2806 * @param redirectedName the name of the redirected constructor return type | 2864 * @param redirectedName the name of the redirected constructor return type |
| 2807 * @param redirectingName the name of the redirecting constructor return type | 2865 * @param redirectingName the name of the redirecting constructor return type |
| 2808 */ | 2866 */ |
| 2809 static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWar
ningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 60, "The return type '%s' of th
e redirected constructor is not assignable to '%s'"); | 2867 static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWar
ningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 61, "The return type '%s' of th
e redirected constructor is not assignable to '%s'"); |
| 2810 | 2868 |
| 2811 /** | 2869 /** |
| 2812 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the | 2870 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the |
| 2813 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the | 2871 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the |
| 2814 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. | 2872 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. |
| 2815 */ | 2873 */ |
| 2816 static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWar
ningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 61, "The constructor '%s' could
not be found in '%s'"); | 2874 static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWar
ningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 62, "The constructor '%s' could
not be found in '%s'"); |
| 2817 | 2875 |
| 2818 /** | 2876 /** |
| 2819 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the | 2877 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the |
| 2820 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the | 2878 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the |
| 2821 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. | 2879 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. |
| 2822 */ | 2880 */ |
| 2823 static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode.c
on1('REDIRECT_TO_NON_CLASS', 62, "The name '%s' is not a type and cannot be used
in a redirected constructor"); | 2881 static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode.c
on1('REDIRECT_TO_NON_CLASS', 63, "The name '%s' is not a type and cannot be used
in a redirected constructor"); |
| 2824 | 2882 |
| 2825 /** | 2883 /** |
| 2826 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form | 2884 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form |
| 2827 * <i>return;</i> It is a static warning if both of the following conditions h
old: | 2885 * <i>return;</i> It is a static warning if both of the following conditions h
old: |
| 2828 * <ol> | 2886 * <ol> |
| 2829 * * <i>f</i> is not a generative constructor. | 2887 * * <i>f</i> is not a generative constructor. |
| 2830 * * The return type of <i>f</i> may not be assigned to void. | 2888 * * The return type of <i>f</i> may not be assigned to void. |
| 2831 * </ol> | 2889 * </ol> |
| 2832 */ | 2890 */ |
| 2833 static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode.co
n1('RETURN_WITHOUT_VALUE', 63, "Missing return value after 'return'"); | 2891 static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode.co
n1('RETURN_WITHOUT_VALUE', 64, "Missing return value after 'return'"); |
| 2834 | 2892 |
| 2835 /** | 2893 /** |
| 2836 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | 2894 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method |
| 2837 * or getter <i>m</i>. | 2895 * or getter <i>m</i>. |
| 2838 * | 2896 * |
| 2839 * @param memberName the name of the instance member | 2897 * @param memberName the name of the instance member |
| 2840 */ | 2898 */ |
| 2841 static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWa
rningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 64, "Instance member '%s' can
not be accessed using static access"); | 2899 static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWa
rningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 65, "Instance member '%s' can
not be accessed using static access"); |
| 2842 | 2900 |
| 2843 /** | 2901 /** |
| 2844 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of | 2902 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of |
| 2845 * <i>e<sub>k</sub></i>. | 2903 * <i>e<sub>k</sub></i>. |
| 2846 */ | 2904 */ |
| 2847 static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 65, "Type '%s' of the switch
expression is not assignable to the type '%s' of case expressions"); | 2905 static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 66, "Type '%s' of the switch
expression is not assignable to the type '%s' of case expressions"); |
| 2848 | 2906 |
| 2849 /** | 2907 /** |
| 2850 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the | 2908 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the |
| 2851 * current lexical scope. | 2909 * current lexical scope. |
| 2852 */ | 2910 */ |
| 2853 static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode.con1
('TYPE_TEST_NON_TYPE', 66, "The name '%s' is not a type and cannot be used in an
'is' expression"); | 2911 static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode.con1
('TYPE_TEST_NON_TYPE', 67, "The name '%s' is not a type and cannot be used in an
'is' expression"); |
| 2854 | 2912 |
| 2855 /** | 2913 /** |
| 2856 * 10 Generics: However, a type parameter is considered to be a malformed type
when referenced by | 2914 * 10 Generics: However, a type parameter is considered to be a malformed type
when referenced by |
| 2857 * a static member. | 2915 * a static member. |
| 2858 * | 2916 * |
| 2859 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni
ng. A malformed type | 2917 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni
ng. A malformed type |
| 2860 * is then interpreted as dynamic by the static type checker and the runtime. | 2918 * is then interpreted as dynamic by the static type checker and the runtime. |
| 2861 */ | 2919 */ |
| 2862 static final StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = new Stati
cWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 67, "Static members can
not reference type parameters"); | 2920 static final StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = new Stati
cWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 68, "Static members can
not reference type parameters"); |
| 2863 | 2921 |
| 2864 /** | 2922 /** |
| 2865 * 12.15.3 Static Invocation: A static method invocation <i>i</i> has the form | 2923 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form |
| 2866 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … | 2924 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … |
| 2867 * 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 | 2925 * 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 |
| 2868 * class in the current scope. | 2926 * class in the current scope. |
| 2869 * | 2927 * |
| 2870 * @param undefinedClassName the name of the undefined class | 2928 * @param undefinedClassName the name of the undefined class |
| 2871 */ | 2929 */ |
| 2872 static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode.con1('U
NDEFINED_CLASS', 68, "Undefined class '%s'"); | 2930 static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode.con1('U
NDEFINED_CLASS', 69, "Undefined class '%s'"); |
| 2873 | 2931 |
| 2874 /** | 2932 /** |
| 2875 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". | 2933 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". |
| 2876 */ | 2934 */ |
| 2877 static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode
.con1('UNDEFINED_CLASS_BOOLEAN', 69, "Undefined class 'boolean'; did you mean 'b
ool'?"); | 2935 static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode
.con1('UNDEFINED_CLASS_BOOLEAN', 70, "Undefined class 'boolean'; did you mean 'b
ool'?"); |
| 2878 | 2936 |
| 2879 /** | 2937 /** |
| 2880 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</
i> in the enclosing | 2938 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</
i> in the enclosing |
| 2881 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e
xplicitly, a getter | 2939 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e
xplicitly, a getter |
| 2882 * named <i>m</i>. | 2940 * named <i>m</i>. |
| 2883 * | 2941 * |
| 2884 * @param getterName the name of the getter | 2942 * @param getterName the name of the getter |
| 2885 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for | 2943 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for |
| 2886 */ | 2944 */ |
| 2887 static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode.con1('
UNDEFINED_GETTER', 70, "There is no such getter '%s' in '%s'"); | 2945 static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode.con1('
UNDEFINED_GETTER', 71, "There is no such getter '%s' in '%s'"); |
| 2888 | 2946 |
| 2889 /** | 2947 /** |
| 2890 * 12.30 Identifier Reference: It is as static warning if an identifier expres
sion of the form | 2948 * 12.30 Identifier Reference: It is as static warning if an identifier expres
sion of the form |
| 2891 * <i>id</i> occurs inside a top level or static function (be it function, met
hod, getter, or | 2949 * <i>id</i> occurs inside a top level or static function (be it function, met
hod, getter, or |
| 2892 * setter) or variable initializer and there is no declaration <i>d</i> with n
ame <i>id</i> in the | 2950 * setter) or variable initializer and there is no declaration <i>d</i> with n
ame <i>id</i> in the |
| 2893 * lexical scope enclosing the expression. | 2951 * lexical scope enclosing the expression. |
| 2894 * | 2952 * |
| 2895 * @param name the name of the identifier | 2953 * @param name the name of the identifier |
| 2896 */ | 2954 */ |
| 2897 static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode.co
n1('UNDEFINED_IDENTIFIER', 71, "Undefined name '%s'"); | 2955 static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode.co
n1('UNDEFINED_IDENTIFIER', 72, "Undefined name '%s'"); |
| 2898 | 2956 |
| 2899 /** | 2957 /** |
| 2900 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
<i>1<=i<=l</i>, | 2958 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
<i>1<=i<=l</i>, |
| 2901 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i
> ... | 2959 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i
> ... |
| 2902 * <i>p<sub>n+k</sub></i>} or a static warning occurs. | 2960 * <i>p<sub>n+k</sub></i>} or a static warning occurs. |
| 2903 * | 2961 * |
| 2904 * @param name the name of the requested named parameter | 2962 * @param name the name of the requested named parameter |
| 2905 */ | 2963 */ |
| 2906 static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCo
de.con1('UNDEFINED_NAMED_PARAMETER', 72, "The named parameter '%s' is not define
d"); | 2964 static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCo
de.con1('UNDEFINED_NAMED_PARAMETER', 73, "The named parameter '%s' is not define
d"); |
| 2907 | 2965 |
| 2908 /** | 2966 /** |
| 2909 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v
= e</i> occurs | 2967 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v
= e</i> occurs |
| 2910 * inside a top level or static function (be it function, method, getter, or s
etter) or variable | 2968 * inside a top level or static function (be it function, method, getter, or s
etter) or variable |
| 2911 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the
lexical scope | 2969 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the
lexical scope |
| 2912 * enclosing the assignment. | 2970 * enclosing the assignment. |
| 2913 * | 2971 * |
| 2914 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t
he enclosing lexical | 2972 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t
he enclosing lexical |
| 2915 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter | 2973 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter |
| 2916 * <i>v=</i>. | 2974 * <i>v=</i>. |
| 2917 * | 2975 * |
| 2918 * @param setterName the name of the getter | 2976 * @param setterName the name of the getter |
| 2919 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for | 2977 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for |
| 2920 */ | 2978 */ |
| 2921 static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode.con1('
UNDEFINED_SETTER', 73, "There is no such setter '%s' in '%s'"); | 2979 static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode.con1('
UNDEFINED_SETTER', 74, "There is no such setter '%s' in '%s'"); |
| 2922 | 2980 |
| 2923 /** | 2981 /** |
| 2924 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | 2982 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method |
| 2925 * or getter <i>m</i>. | 2983 * or getter <i>m</i>. |
| 2926 * | 2984 * |
| 2927 * @param methodName the name of the method | 2985 * @param methodName the name of the method |
| 2928 * @param enclosingType the name of the enclosing type where the method is bei
ng looked for | 2986 * @param enclosingType the name of the enclosing type where the method is bei
ng looked for |
| 2929 */ | 2987 */ |
| 2930 static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticW
arningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 74, "There is no such stati
c method '%s' in '%s'"); | 2988 static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticW
arningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 75, "There is no such stati
c method, getter or setter '%s' in '%s'"); |
| 2989 |
| 2931 static final List<StaticWarningCode> values = [ | 2990 static final List<StaticWarningCode> values = [ |
| 2932 AMBIGUOUS_IMPORT, | 2991 AMBIGUOUS_IMPORT, |
| 2933 ARGUMENT_TYPE_NOT_ASSIGNABLE, | 2992 ARGUMENT_TYPE_NOT_ASSIGNABLE, |
| 2934 ASSIGNMENT_TO_CONST, | 2993 ASSIGNMENT_TO_CONST, |
| 2935 ASSIGNMENT_TO_FINAL, | 2994 ASSIGNMENT_TO_FINAL, |
| 2936 ASSIGNMENT_TO_METHOD, | 2995 ASSIGNMENT_TO_METHOD, |
| 2937 CASE_BLOCK_NOT_TERMINATED, | 2996 CASE_BLOCK_NOT_TERMINATED, |
| 2938 CAST_TO_NON_TYPE, | 2997 CAST_TO_NON_TYPE, |
| 2939 CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, | 2998 CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, |
| 2940 CONFLICTING_DART_IMPORT, | 2999 CONFLICTING_DART_IMPORT, |
| 2941 CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, | 3000 CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, |
| 3001 CONFLICTING_INSTANCE_METHOD_SETTER, |
| 2942 CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, | 3002 CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, |
| 2943 CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, | 3003 CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, |
| 2944 CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER, | 3004 CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER, |
| 2945 CONST_WITH_ABSTRACT_CLASS, | 3005 CONST_WITH_ABSTRACT_CLASS, |
| 2946 EQUAL_KEYS_IN_MAP, | 3006 EQUAL_KEYS_IN_MAP, |
| 2947 EXPORT_DUPLICATED_LIBRARY_NAME, | 3007 EXPORT_DUPLICATED_LIBRARY_NAME, |
| 2948 EXTRA_POSITIONAL_ARGUMENTS, | 3008 EXTRA_POSITIONAL_ARGUMENTS, |
| 2949 FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, | 3009 FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, |
| 2950 FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, | 3010 FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, |
| 2951 FIELD_INITIALIZER_NOT_ASSIGNABLE, | 3011 FIELD_INITIALIZER_NOT_ASSIGNABLE, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3028 /** | 3088 /** |
| 3029 * Initialize a newly created error code to have the given message and correct
ion. | 3089 * Initialize a newly created error code to have the given message and correct
ion. |
| 3030 * | 3090 * |
| 3031 * @param message the template used to create the message to be displayed for
the error | 3091 * @param message the template used to create the message to be displayed for
the error |
| 3032 * @param correction the template used to create the correction to be displaye
d for the error | 3092 * @param correction the template used to create the correction to be displaye
d for the error |
| 3033 */ | 3093 */ |
| 3034 StaticWarningCode.con2(String name, int ordinal, String message, String correc
tion) : super(name, ordinal) { | 3094 StaticWarningCode.con2(String name, int ordinal, String message, String correc
tion) : super(name, ordinal) { |
| 3035 this._message = message; | 3095 this._message = message; |
| 3036 this.correction7 = correction; | 3096 this.correction7 = correction; |
| 3037 } | 3097 } |
| 3098 |
| 3038 String get correction => correction7; | 3099 String get correction => correction7; |
| 3100 |
| 3039 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; | 3101 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; |
| 3102 |
| 3040 String get message => _message; | 3103 String get message => _message; |
| 3104 |
| 3041 ErrorType get type => ErrorType.STATIC_WARNING; | 3105 ErrorType get type => ErrorType.STATIC_WARNING; |
| 3042 } | 3106 } |
| 3107 |
| 3043 /** | 3108 /** |
| 3044 * The interface `AnalysisErrorListener` defines the behavior of objects that li
sten for | 3109 * The interface `AnalysisErrorListener` defines the behavior of objects that li
sten for |
| 3045 * [AnalysisError] being produced by the analysis engine. | 3110 * [AnalysisError] being produced by the analysis engine. |
| 3046 * | 3111 * |
| 3047 * @coverage dart.engine.error | 3112 * @coverage dart.engine.error |
| 3048 */ | 3113 */ |
| 3049 abstract class AnalysisErrorListener { | 3114 abstract class AnalysisErrorListener { |
| 3050 | |
| 3051 /** | 3115 /** |
| 3052 * An error listener that ignores errors that are reported to it. | 3116 * An error listener that ignores errors that are reported to it. |
| 3053 */ | 3117 */ |
| 3054 static final AnalysisErrorListener _NULL_LISTENER = new AnalysisErrorListener_
6(); | 3118 static final AnalysisErrorListener _NULL_LISTENER = new AnalysisErrorListener_
6(); |
| 3055 | 3119 |
| 3056 /** | 3120 /** |
| 3057 * This method is invoked when an error has been found by the analysis engine. | 3121 * This method is invoked when an error has been found by the analysis engine. |
| 3058 * | 3122 * |
| 3059 * @param error the error that was just found (not `null`) | 3123 * @param error the error that was just found (not `null`) |
| 3060 */ | 3124 */ |
| 3061 void onError(AnalysisError error); | 3125 void onError(AnalysisError error); |
| 3062 } | 3126 } |
| 3127 |
| 3063 class AnalysisErrorListener_6 implements AnalysisErrorListener { | 3128 class AnalysisErrorListener_6 implements AnalysisErrorListener { |
| 3064 void onError(AnalysisError event) { | 3129 void onError(AnalysisError event) { |
| 3065 } | 3130 } |
| 3066 } | 3131 } |
| 3132 |
| 3067 /** | 3133 /** |
| 3068 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i
n HTML files. | 3134 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i
n HTML files. |
| 3069 * The convention for this class is for the name of the error code to indicate t
he problem that | 3135 * The convention for this class is for the name of the error code to indicate t
he problem that |
| 3070 * caused the error to be generated and for the error message to explain what is
wrong and, when | 3136 * caused the error to be generated and for the error message to explain what is
wrong and, when |
| 3071 * appropriate, how the problem can be corrected. | 3137 * appropriate, how the problem can be corrected. |
| 3072 * | 3138 * |
| 3073 * @coverage dart.engine.error | 3139 * @coverage dart.engine.error |
| 3074 */ | 3140 */ |
| 3075 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { | 3141 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { |
| 3076 | |
| 3077 /** | 3142 /** |
| 3078 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag is not a | 3143 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag is not a |
| 3079 * valid URI. | 3144 * valid URI. |
| 3080 * | 3145 * |
| 3081 * @param uri the URI that is invalid | 3146 * @param uri the URI that is invalid |
| 3082 */ | 3147 */ |
| 3083 static final HtmlWarningCode INVALID_URI = new HtmlWarningCode.con1('INVALID_U
RI', 0, "Invalid URI syntax: '%s'"); | 3148 static final HtmlWarningCode INVALID_URI = new HtmlWarningCode.con1('INVALID_U
RI', 0, "Invalid URI syntax: '%s'"); |
| 3084 | 3149 |
| 3085 /** | 3150 /** |
| 3086 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag references | 3151 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag references |
| 3087 * a file that does not exist. | 3152 * a file that does not exist. |
| 3088 * | 3153 * |
| 3089 * @param uri the URI pointing to a non-existent file | 3154 * @param uri the URI pointing to a non-existent file |
| 3090 */ | 3155 */ |
| 3091 static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode.con1('UR
I_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'"); | 3156 static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode.con1('UR
I_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'"); |
| 3157 |
| 3092 static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST]; | 3158 static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST]; |
| 3093 | 3159 |
| 3094 /** | 3160 /** |
| 3095 * The template used to create the message to be displayed for this error. | 3161 * The template used to create the message to be displayed for this error. |
| 3096 */ | 3162 */ |
| 3097 String _message; | 3163 String _message; |
| 3098 | 3164 |
| 3099 /** | 3165 /** |
| 3100 * The template used to create the correction to be displayed for this error,
or `null` if | 3166 * The template used to create the correction to be displayed for this error,
or `null` if |
| 3101 * there is no correction information for this error. | 3167 * there is no correction information for this error. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 3114 /** | 3180 /** |
| 3115 * Initialize a newly created error code to have the given message and correct
ion. | 3181 * Initialize a newly created error code to have the given message and correct
ion. |
| 3116 * | 3182 * |
| 3117 * @param message the template used to create the message to be displayed for
the error | 3183 * @param message the template used to create the message to be displayed for
the error |
| 3118 * @param correction the template used to create the correction to be displaye
d for the error | 3184 * @param correction the template used to create the correction to be displaye
d for the error |
| 3119 */ | 3185 */ |
| 3120 HtmlWarningCode.con2(String name, int ordinal, String message, String correcti
on) : super(name, ordinal) { | 3186 HtmlWarningCode.con2(String name, int ordinal, String message, String correcti
on) : super(name, ordinal) { |
| 3121 this._message = message; | 3187 this._message = message; |
| 3122 this.correction4 = correction; | 3188 this.correction4 = correction; |
| 3123 } | 3189 } |
| 3190 |
| 3124 String get correction => correction4; | 3191 String get correction => correction4; |
| 3192 |
| 3125 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; | 3193 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; |
| 3194 |
| 3126 String get message => _message; | 3195 String get message => _message; |
| 3196 |
| 3127 ErrorType get type => ErrorType.STATIC_WARNING; | 3197 ErrorType get type => ErrorType.STATIC_WARNING; |
| 3128 } | 3198 } |
| 3199 |
| 3129 /** | 3200 /** |
| 3130 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat
ic type | 3201 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat
ic type |
| 3131 * warnings. The convention for this class is for the name of the error code to
indicate the problem | 3202 * warnings. The convention for this class is for the name of the error code to
indicate the problem |
| 3132 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | 3203 * that caused the error to be generated and for the error message to explain wh
at is wrong and, |
| 3133 * when appropriate, how the problem can be corrected. | 3204 * when appropriate, how the problem can be corrected. |
| 3134 * | 3205 * |
| 3135 * @coverage dart.engine.error | 3206 * @coverage dart.engine.error |
| 3136 */ | 3207 */ |
| 3137 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
Code { | 3208 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
Code { |
| 3138 | |
| 3139 /** | 3209 /** |
| 3140 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas
s implements the | 3210 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas
s implements the |
| 3141 * built-in class <i>List<E></i> is allocated. | 3211 * built-in class <i>List<E></i> is allocated. |
| 3142 * | 3212 * |
| 3143 * @param numTypeArgument the number of provided type arguments | 3213 * @param numTypeArgument the number of provided type arguments |
| 3144 */ | 3214 */ |
| 3145 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"); | 3215 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"); |
| 3146 | 3216 |
| 3147 /** | 3217 /** |
| 3148 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
implements the | 3218 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
implements the |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3387 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
generic type with | 3457 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
generic type with |
| 3388 * exactly <i>n</i> type parameters. | 3458 * exactly <i>n</i> type parameters. |
| 3389 * | 3459 * |
| 3390 * @param typeName the name of the type being referenced (<i>G</i>) | 3460 * @param typeName the name of the type being referenced (<i>G</i>) |
| 3391 * @param parameterCount the number of type parameters that were declared | 3461 * @param parameterCount the number of type parameters that were declared |
| 3392 * @param argumentCount the number of type arguments provided | 3462 * @param argumentCount the number of type arguments provided |
| 3393 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS | 3463 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS |
| 3394 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS | 3464 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS |
| 3395 */ | 3465 */ |
| 3396 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"); | 3466 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"); |
| 3467 |
| 3397 static final List<StaticTypeWarningCode> values = [ | 3468 static final List<StaticTypeWarningCode> values = [ |
| 3398 EXPECTED_ONE_LIST_TYPE_ARGUMENTS, | 3469 EXPECTED_ONE_LIST_TYPE_ARGUMENTS, |
| 3399 EXPECTED_TWO_MAP_TYPE_ARGUMENTS, | 3470 EXPECTED_TWO_MAP_TYPE_ARGUMENTS, |
| 3400 INACCESSIBLE_SETTER, | 3471 INACCESSIBLE_SETTER, |
| 3401 INCONSISTENT_METHOD_INHERITANCE, | 3472 INCONSISTENT_METHOD_INHERITANCE, |
| 3402 INSTANCE_ACCESS_TO_STATIC_MEMBER, | 3473 INSTANCE_ACCESS_TO_STATIC_MEMBER, |
| 3403 INVALID_ASSIGNMENT, | 3474 INVALID_ASSIGNMENT, |
| 3404 INVOCATION_OF_NON_FUNCTION, | 3475 INVOCATION_OF_NON_FUNCTION, |
| 3405 INVOCATION_OF_NON_FUNCTION_EXPRESSION, | 3476 INVOCATION_OF_NON_FUNCTION_EXPRESSION, |
| 3406 NON_BOOL_CONDITION, | 3477 NON_BOOL_CONDITION, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3441 /** | 3512 /** |
| 3442 * Initialize a newly created error code to have the given message and correct
ion. | 3513 * Initialize a newly created error code to have the given message and correct
ion. |
| 3443 * | 3514 * |
| 3444 * @param message the template used to create the message to be displayed for
the error | 3515 * @param message the template used to create the message to be displayed for
the error |
| 3445 * @param correction the template used to create the correction to be displaye
d for the error | 3516 * @param correction the template used to create the correction to be displaye
d for the error |
| 3446 */ | 3517 */ |
| 3447 StaticTypeWarningCode.con2(String name, int ordinal, String message, String co
rrection) : super(name, ordinal) { | 3518 StaticTypeWarningCode.con2(String name, int ordinal, String message, String co
rrection) : super(name, ordinal) { |
| 3448 this._message = message; | 3519 this._message = message; |
| 3449 this.correction6 = correction; | 3520 this.correction6 = correction; |
| 3450 } | 3521 } |
| 3522 |
| 3451 String get correction => correction6; | 3523 String get correction => correction6; |
| 3524 |
| 3452 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; | 3525 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; |
| 3526 |
| 3453 String get message => _message; | 3527 String get message => _message; |
| 3528 |
| 3454 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; | 3529 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; |
| 3455 } | 3530 } |
| OLD | NEW |