Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.error; | 8 library engine.error; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * Initialize a newly created analysis error for the specified source. The err or has no location | 92 * Initialize a newly created analysis error for the specified source. The err or has no location |
| 93 * information. | 93 * information. |
| 94 * | 94 * |
| 95 * @param source the source for which the exception occurred | 95 * @param source the source for which the exception occurred |
| 96 * @param errorCode the error code to be associated with this error | 96 * @param errorCode the error code to be associated with this error |
| 97 * @param arguments the arguments used to build the error message | 97 * @param arguments the arguments used to build the error message |
| 98 */ | 98 */ |
| 99 AnalysisError.con1(this.source, this.errorCode, List<Object> arguments) { | 99 AnalysisError.con1(this.source, this.errorCode, List<Object> arguments) { |
| 100 this._message = JavaString.format(errorCode.message, arguments); | 100 this._message = formatList(errorCode.message, arguments); |
| 101 } | 101 } |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * Initialize a newly created analysis error for the specified source at the g iven location. | 104 * Initialize a newly created analysis error for the specified source at the g iven location. |
| 105 * | 105 * |
| 106 * @param source the source for which the exception occurred | 106 * @param source the source for which the exception occurred |
| 107 * @param offset the offset of the location of the error | 107 * @param offset the offset of the location of the error |
| 108 * @param length the length of the location of the error | 108 * @param length the length of the location of the error |
| 109 * @param errorCode the error code to be associated with this error | 109 * @param errorCode the error code to be associated with this error |
| 110 * @param arguments the arguments used to build the error message | 110 * @param arguments the arguments used to build the error message |
| 111 */ | 111 */ |
| 112 AnalysisError.con2(this.source, int offset, int length, this.errorCode, List<O bject> arguments) { | 112 AnalysisError.con2(this.source, int offset, int length, this.errorCode, List<O bject> arguments) { |
| 113 this._offset = offset; | 113 this._offset = offset; |
| 114 this._length = length; | 114 this._length = length; |
| 115 this._message = JavaString.format(errorCode.message, arguments); | 115 this._message = formatList(errorCode.message, arguments); |
| 116 String correctionTemplate = errorCode.correction; | 116 String correctionTemplate = errorCode.correction; |
| 117 if (correctionTemplate != null) { | 117 if (correctionTemplate != null) { |
| 118 this._correction = JavaString.format(correctionTemplate, arguments); | 118 this._correction = formatList(correctionTemplate, arguments); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 @override | 122 @override |
| 123 bool operator ==(Object obj) { | 123 bool operator ==(Object obj) { |
| 124 if (identical(obj, this)) { | 124 if (identical(obj, this)) { |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| 127 // prepare other AnalysisError | 127 // prepare other AnalysisError |
| 128 if (obj is! AnalysisError) { | 128 if (obj is! AnalysisError) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 */ | 280 */ |
| 281 void setProperty(ErrorProperty property, Object value) { | 281 void setProperty(ErrorProperty property, Object value) { |
| 282 _propertyMap[property] = value; | 282 _propertyMap[property] = value; |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 /** | 286 /** |
| 287 * The enumeration `AngularCode` defines Angular specific problems. | 287 * The enumeration `AngularCode` defines Angular specific problems. |
| 288 */ | 288 */ |
| 289 class AngularCode extends Enum<AngularCode> implements ErrorCode { | 289 class AngularCode extends Enum<AngularCode> implements ErrorCode { |
| 290 static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode('CANNOT_PAR SE_SELECTOR', 0, "The selector '%s' cannot be parsed"); | 290 static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode("CANNOT_PAR SE_SELECTOR", 0, "The selector '{0}' cannot be parsed"); |
|
Brian Wilkerson
2014/08/13 20:45:04
Why the change from single to double quotes as del
scheglov
2014/08/13 21:51:44
Fixed.
| |
| 291 | 291 |
| 292 static const AngularCode INVALID_FORMATTER_NAME = const AngularCode('INVALID_F ORMATTER_NAME', 1, "Formatter name must be a simple identifier"); | 292 static const AngularCode INVALID_FORMATTER_NAME = const AngularCode("INVALID_F ORMATTER_NAME", 1, "Formatter name must be a simple identifier"); |
| 293 | 293 |
| 294 static const AngularCode INVALID_PROPERTY_KIND = const AngularCode('INVALID_PR OPERTY_KIND', 2, "Unknown property binding kind '%s', use one of the '@', '=>', '=>!' or '<=>'"); | 294 static const AngularCode INVALID_PROPERTY_KIND = const AngularCode("INVALID_PR OPERTY_KIND", 2, "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'"); |
| 295 | 295 |
| 296 static const AngularCode INVALID_PROPERTY_FIELD = const AngularCode('INVALID_P ROPERTY_FIELD', 3, "Unknown property field '%s'"); | 296 static const AngularCode INVALID_PROPERTY_FIELD = const AngularCode("INVALID_P ROPERTY_FIELD", 3, "Unknown property field '{0}'"); |
| 297 | 297 |
| 298 static const AngularCode INVALID_PROPERTY_MAP = const AngularCode('INVALID_PRO PERTY_MAP', 4, "Argument 'map' must be a constant map literal"); | 298 static const AngularCode INVALID_PROPERTY_MAP = const AngularCode("INVALID_PRO PERTY_MAP", 4, "Argument 'map' must be a constant map literal"); |
| 299 | 299 |
| 300 static const AngularCode INVALID_PROPERTY_NAME = const AngularCode('INVALID_PR OPERTY_NAME', 5, "Property name must be a string literal"); | 300 static const AngularCode INVALID_PROPERTY_NAME = const AngularCode("INVALID_PR OPERTY_NAME", 5, "Property name must be a string literal"); |
| 301 | 301 |
| 302 static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode('INVALID_PR OPERTY_SPEC', 6, "Property binding specification must be a string literal"); | 302 static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode("INVALID_PR OPERTY_SPEC", 6, "Property binding specification must be a string literal"); |
| 303 | 303 |
| 304 static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode('INVALID_RE PEAT_SYNTAX', 7, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'"); | 304 static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode("INVALID_RE PEAT_SYNTAX", 7, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'"); |
| 305 | 305 |
| 306 static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode('INVAL ID_REPEAT_ITEM_SYNTAX', 8, "Item must by identifier or in '(_key_, _value_)' pai r."); | 306 static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode("INVAL ID_REPEAT_ITEM_SYNTAX", 8, "Item must by identifier or in '(_key_, _value_)' pai r."); |
| 307 | 307 |
| 308 static const AngularCode INVALID_URI = const AngularCode('INVALID_URI', 9, "In valid URI syntax: '%s'"); | 308 static const AngularCode INVALID_URI = const AngularCode("INVALID_URI", 9, "In valid URI syntax: '{0}'"); |
| 309 | 309 |
| 310 static const AngularCode MISSING_FORMATTER_COLON = const AngularCode('MISSING_ FORMATTER_COLON', 10, "Missing ':' before formatter argument"); | 310 static const AngularCode MISSING_FORMATTER_COLON = const AngularCode("MISSING_ FORMATTER_COLON", 10, "Missing ':' before formatter argument"); |
| 311 | 311 |
| 312 static const AngularCode MISSING_NAME = const AngularCode('MISSING_NAME', 11, "Argument 'name' must be provided"); | 312 static const AngularCode MISSING_NAME = const AngularCode("MISSING_NAME", 11, "Argument 'name' must be provided"); |
| 313 | 313 |
| 314 static const AngularCode MISSING_PUBLISH_AS = const AngularCode('MISSING_PUBLI SH_AS', 12, "Argument 'publishAs' must be provided"); | 314 static const AngularCode MISSING_PUBLISH_AS = const AngularCode("MISSING_PUBLI SH_AS", 12, "Argument 'publishAs' must be provided"); |
| 315 | 315 |
| 316 static const AngularCode MISSING_SELECTOR = const AngularCode('MISSING_SELECTO R', 13, "Argument 'selector' must be provided"); | 316 static const AngularCode MISSING_SELECTOR = const AngularCode("MISSING_SELECTO R", 13, "Argument 'selector' must be provided"); |
| 317 | 317 |
| 318 static const AngularCode URI_DOES_NOT_EXIST = const AngularCode('URI_DOES_NOT_ EXIST', 14, "Target of URI does not exist: '%s'"); | 318 static const AngularCode URI_DOES_NOT_EXIST = const AngularCode("URI_DOES_NOT_ EXIST", 14, "Target of URI does not exist: '{0}'"); |
| 319 | 319 |
| 320 static const List<AngularCode> values = const [ | 320 static const List<AngularCode> values = const [ |
| 321 CANNOT_PARSE_SELECTOR, | 321 CANNOT_PARSE_SELECTOR, |
| 322 INVALID_FORMATTER_NAME, | 322 INVALID_FORMATTER_NAME, |
| 323 INVALID_PROPERTY_KIND, | 323 INVALID_PROPERTY_KIND, |
| 324 INVALID_PROPERTY_FIELD, | 324 INVALID_PROPERTY_FIELD, |
| 325 INVALID_PROPERTY_MAP, | 325 INVALID_PROPERTY_MAP, |
| 326 INVALID_PROPERTY_NAME, | 326 INVALID_PROPERTY_NAME, |
| 327 INVALID_PROPERTY_SPEC, | 327 INVALID_PROPERTY_SPEC, |
| 328 INVALID_REPEAT_SYNTAX, | 328 INVALID_REPEAT_SYNTAX, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time | 386 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time |
| 387 * errors. The convention for this class is for the name of the error code to in dicate the problem | 387 * errors. The convention for this class is for the name of the error code to in dicate the problem |
| 388 * that caused the error to be generated and for the error message to explain wh at is wrong and, | 388 * that caused the error to be generated and for the error message to explain wh at is wrong and, |
| 389 * when appropriate, how the problem can be corrected. | 389 * when appropriate, how the problem can be corrected. |
| 390 */ | 390 */ |
| 391 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de { | 391 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de { |
| 392 /** | 392 /** |
| 393 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or | 393 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or |
| 394 * 'const' or to access its private fields. | 394 * 'const' or to access its private fields. |
| 395 */ | 395 */ |
| 396 static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTim eErrorCode.con1('ACCESS_PRIVATE_ENUM_FIELD', 0, "The private fields of an enum c annot be accessed, even within the same library"); | 396 static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTim eErrorCode.con1("ACCESS_PRIVATE_ENUM_FIELD", 0, "The private fields of an enum c annot be accessed, even within the same library"); |
| 397 | 397 |
| 398 /** | 398 /** |
| 399 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library | 399 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library |
| 400 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b y more than one | 400 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b y more than one |
| 401 * export, unless each all exports refer to same declaration for the name N. | 401 * export, unless each all exports refer to same declaration for the name N. |
| 402 * | 402 * |
| 403 * @param ambiguousElementName the name of the ambiguous element | 403 * @param ambiguousElementName the name of the ambiguous element |
| 404 * @param firstLibraryName the name of the first library that the type is foun d | 404 * @param firstLibraryName the name of the first library that the type is foun d |
| 405 * @param secondLibraryName the name of the second library that the type is fo und | 405 * @param secondLibraryName the name of the second library that the type is fo und |
| 406 */ | 406 */ |
| 407 static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCod e.con1('AMBIGUOUS_EXPORT', 1, "The name '%s' is defined in the libraries '%s' an d '%s'"); | 407 static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCod e.con1("AMBIGUOUS_EXPORT", 1, "The name '{0}' is defined in the libraries '{1}' and '{2}'"); |
| 408 | 408 |
| 409 /** | 409 /** |
| 410 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal | 410 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal |
| 411 * parameter. | 411 * parameter. |
| 412 * | 412 * |
| 413 * @param the name of the identifier in the argument definition test that is n ot a parameter | 413 * @param the name of the identifier in the argument definition test that is n ot a parameter |
| 414 */ | 414 */ |
| 415 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = con st CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 2, "'%s' is not a parameter"); | 415 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = con st CompileTimeErrorCode.con1("ARGUMENT_DEFINITION_TEST_NON_PARAMETER", 2, "'{0}' is not a parameter"); |
| 416 | 416 |
| 417 /** | 417 /** |
| 418 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id entifier other than | 418 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id entifier other than |
| 419 * dynamic as a type annotation. | 419 * dynamic as a type annotation. |
| 420 */ | 420 */ |
| 421 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileT imeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 3, "The built-in identifier '%s ' cannot be as a type"); | 421 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileT imeErrorCode.con1("BUILT_IN_IDENTIFIER_AS_TYPE", 3, "The built-in identifier '{0 }' cannot be as a type"); |
| 422 | 422 |
| 423 /** | 423 /** |
| 424 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the | 424 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the |
| 425 * declared name of a class, type parameter or type alias. | 425 * declared name of a class, type parameter or type alias. |
| 426 */ | 426 */ |
| 427 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const Com pileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 4, "The built-in iden tifier '%s' cannot be used as a type name"); | 427 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const Com pileTimeErrorCode.con1("BUILT_IN_IDENTIFIER_AS_TYPE_NAME", 4, "The built-in iden tifier '{0}' cannot be used as a type name"); |
| 428 | 428 |
| 429 /** | 429 /** |
| 430 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the | 430 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the |
| 431 * declared name of a class, type parameter or type alias. | 431 * declared name of a class, type parameter or type alias. |
| 432 */ | 432 */ |
| 433 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 5, "The built-i n identifier '%s' cannot be used as a type alias name"); | 433 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode.con1("BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME", 5, "The built-i n identifier '{0}' cannot be used as a type alias name"); |
| 434 | 434 |
| 435 /** | 435 /** |
| 436 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the | 436 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the |
| 437 * declared name of a class, type parameter or type alias. | 437 * declared name of a class, type parameter or type alias. |
| 438 */ | 438 */ |
| 439 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 6 , "The built-in identifier '%s' cannot be used as a type parameter name"); | 439 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode.con1("BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME", 6 , "The built-in identifier '{0}' cannot be used as a type parameter name"); |
| 440 | 440 |
| 441 /** | 441 /** |
| 442 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th e operator | 442 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th e operator |
| 443 * <i>==</i>. | 443 * <i>==</i>. |
| 444 */ | 444 */ |
| 445 static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = con st CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 7, "The s witch case expression type '%s' cannot override the == operator"); | 445 static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = con st CompileTimeErrorCode.con1("CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS", 7, "The s witch case expression type '{0}' cannot override the == operator"); |
| 446 | 446 |
| 447 /** | 447 /** |
| 448 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise | 448 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise |
| 449 * an exception. | 449 * an exception. |
| 450 */ | 450 */ |
| 451 static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = con st CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 8, ""); | 451 static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = con st CompileTimeErrorCode.con1("COMPILE_TIME_CONSTANT_RAISES_EXCEPTION", 8, ""); |
| 452 | 452 |
| 453 /** | 453 /** |
| 454 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same | 454 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same |
| 455 * name. This restriction holds regardless of whether the getter is defined ex plicitly or | 455 * name. This restriction holds regardless of whether the getter is defined ex plicitly or |
| 456 * implicitly, or whether the getter or the method are inherited or not. | 456 * implicitly, or whether the getter or the method are inherited or not. |
| 457 */ | 457 */ |
| 458 static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const Compil eTimeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 9, "Class '%s' cannot have both getter '%s.%s' and method with the same name"); | 458 static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const Compil eTimeErrorCode.con1("CONFLICTING_GETTER_AND_METHOD", 9, "Class '{0}' cannot have both getter '{1}.{2}' and method with the same name"); |
| 459 | 459 |
| 460 /** | 460 /** |
| 461 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same | 461 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same |
| 462 * name. This restriction holds regardless of whether the getter is defined ex plicitly or | 462 * name. This restriction holds regardless of whether the getter is defined ex plicitly or |
| 463 * implicitly, or whether the getter or the method are inherited or not. | 463 * implicitly, or whether the getter or the method are inherited or not. |
| 464 */ | 464 */ |
| 465 static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const Compil eTimeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 10, "Class '%s' cannot have both method '%s.%s' and getter with the same name"); | 465 static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const Compil eTimeErrorCode.con1("CONFLICTING_METHOD_AND_GETTER", 10, "Class '{0}' cannot hav e both method '{1}.{2}' and getter with the same name"); |
| 466 | 466 |
| 467 /** | 467 /** |
| 468 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing | 468 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing |
| 469 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a | 469 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a |
| 470 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing | 470 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing |
| 471 * class. | 471 * class. |
| 472 */ | 472 */ |
| 473 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = con st CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 11, "'%s' cannot be used to name a constructor and a field in this class"); | 473 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = con st CompileTimeErrorCode.con1("CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD", 11, "'{0} ' cannot be used to name a constructor and a field in this class"); |
| 474 | 474 |
| 475 /** | 475 /** |
| 476 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing | 476 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing |
| 477 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a | 477 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a |
| 478 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing | 478 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing |
| 479 * class. | 479 * class. |
| 480 */ | 480 */ |
| 481 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = co nst CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 12, "'% s' cannot be used to name a constructor and a method in this class"); | 481 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = co nst CompileTimeErrorCode.con1("CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD", 12, "'{ 0}' cannot be used to name a constructor and a method in this class"); |
| 482 | 482 |
| 483 /** | 483 /** |
| 484 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the | 484 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the |
| 485 * same name as the class or any of its members or constructors. | 485 * same name as the class or any of its members or constructors. |
| 486 */ | 486 */ |
| 487 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 13, "'%s' canno t be used to name a type varaible in a class with the same name"); | 487 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode.con1("CONFLICTING_TYPE_VARIABLE_AND_CLASS", 13, "'{0}' cann ot be used to name a type varaible in a class with the same name"); |
| 488 | 488 |
| 489 /** | 489 /** |
| 490 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the | 490 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the |
| 491 * same name as the class or any of its members or constructors. | 491 * same name as the class or any of its members or constructors. |
| 492 */ | 492 */ |
| 493 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 14, "'%s' can not be used to name a type varaible and member in this class"); | 493 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode.con1("CONFLICTING_TYPE_VARIABLE_AND_MEMBER", 14, "'{0}' ca nnot be used to name a type varaible and member in this class"); |
| 494 | 494 |
| 495 /** | 495 /** |
| 496 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 496 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 497 * uncaught exception being thrown. | 497 * uncaught exception being thrown. |
| 498 */ | 498 */ |
| 499 static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const C ompileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 15, "'const' cons tructors cannot throw exceptions"); | 499 static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const C ompileTimeErrorCode.con1("CONST_CONSTRUCTOR_THROWS_EXCEPTION", 15, "'const' cons tructors cannot throw exceptions"); |
| 500 | 500 |
| 501 /** | 501 /** |
| 502 * 10.6.3 Constant Constructors: It is a compile-time error if a constant cons tructor is declared | 502 * 10.6.3 Constant Constructors: It is a compile-time error if a constant cons tructor is declared |
| 503 * by a class C if any instance variable declared in C is initialized with an expression that is | 503 * by a class C if any instance variable declared in C is initialized with an expression that is |
| 504 * not a constant expression. | 504 * not a constant expression. |
| 505 */ | 505 */ |
| 506 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_ NON_CONST = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_FIELD_INITIA LIZED_BY_NON_CONST', 16, "Can't define the 'const' constructor because the field '%s' is initialized with a non-constant value"); | 506 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_ NON_CONST = const CompileTimeErrorCode.con1("CONST_CONSTRUCTOR_WITH_FIELD_INITIA LIZED_BY_NON_CONST", 16, "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value"); |
| 507 | 507 |
| 508 /** | 508 /** |
| 509 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in | 509 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in |
| 510 * the initializer list of a constant constructor must specify a constant cons tructor of the | 510 * the initializer list of a constant constructor must specify a constant cons tructor of the |
| 511 * superclass of the immediately enclosing class or a compile-time error occur s. | 511 * superclass of the immediately enclosing class or a compile-time error occur s. |
| 512 * | 512 * |
| 513 * 9 Mixins: For each generative constructor named ... an implicitly declared constructor named | 513 * 9 Mixins: For each generative constructor named ... an implicitly declared constructor named |
| 514 * ... is declared. | 514 * ... is declared. |
| 515 */ | 515 */ |
| 516 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const Compile TimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_MIXIN', 17, "Constant constructor can not be declared for a class with a mixin"); | 516 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const Compile TimeErrorCode.con1("CONST_CONSTRUCTOR_WITH_MIXIN", 17, "Constant constructor can not be declared for a class with a mixin"); |
| 517 | 517 |
| 518 /** | 518 /** |
| 519 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in | 519 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in |
| 520 * the initializer list of a constant constructor must specify a constant cons tructor of the | 520 * the initializer list of a constant constructor must specify a constant cons tructor of the |
| 521 * superclass of the immediately enclosing class or a compile-time error occur s. | 521 * superclass of the immediately enclosing class or a compile-time error occur s. |
| 522 */ | 522 */ |
| 523 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = con st CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 18, "Cons tant constructor cannot call non-constant super constructor of '%s'"); | 523 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = con st CompileTimeErrorCode.con1("CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER", 18, "Cons tant constructor cannot call non-constant super constructor of '{0}'"); |
| 524 | 524 |
| 525 /** | 525 /** |
| 526 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const ructor is declared | 526 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const ructor is declared |
| 527 * by a class that has a non-final instance variable. | 527 * by a class that has a non-final instance variable. |
| 528 * | 528 * |
| 529 * The above refers to both locally declared and inherited instance variables. | 529 * The above refers to both locally declared and inherited instance variables. |
| 530 */ | 530 */ |
| 531 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = con st CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 19, "Cann ot define the 'const' constructor for a class with non-final fields"); | 531 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = con st CompileTimeErrorCode.con1("CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD", 19, "Cann ot define the 'const' constructor for a class with non-final fields"); |
| 532 | 532 |
| 533 /** | 533 /** |
| 534 * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type. | 534 * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type. |
| 535 */ | 535 */ |
| 536 static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErro rCode.con1('CONST_DEFERRED_CLASS', 20, "Deferred classes cannot be created with 'const'"); | 536 static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErro rCode.con1("CONST_DEFERRED_CLASS", 20, "Deferred classes cannot be created with 'const'"); |
| 537 | 537 |
| 538 /** | 538 /** |
| 539 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not | 539 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not |
| 540 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of | 540 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of |
| 541 * the field <i>v</i>. | 541 * the field <i>v</i>. |
| 542 * | 542 * |
| 543 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 543 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 544 * uncaught exception being thrown. | 544 * uncaught exception being thrown. |
| 545 * | 545 * |
| 546 * @param initializerType the name of the type of the initializer expression | 546 * @param initializerType the name of the type of the initializer expression |
| 547 * @param fieldType the name of the type of the field | 547 * @param fieldType the name of the type of the field |
| 548 */ | 548 */ |
| 549 static const CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = con st CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 21, "The initializer type '%s' cannot be assigned to the field type '%s'"); | 549 static const CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = con st CompileTimeErrorCode.con1("CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE", 21, "The initializer type '{0}' cannot be assigned to the field type '{1}'"); |
| 550 | 550 |
| 551 /** | 551 /** |
| 552 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a | 552 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a |
| 553 * constant variable. | 553 * constant variable. |
| 554 */ | 554 */ |
| 555 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode.con1('CONST_FORMAL_PARAMETER', 22, "Parameters cannot be 'const'"); | 555 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode.con1("CONST_FORMAL_PARAMETER", 22, "Parameters cannot be 'const'"); |
| 556 | 556 |
| 557 /** | 557 /** |
| 558 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a | 558 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a |
| 559 * compile-time error occurs. | 559 * compile-time error occurs. |
| 560 */ | 560 */ |
| 561 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 23, "'const' variables must be constant value"); | 561 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1("CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE", 23, "'const' variables must be constant value"); |
| 562 | 562 |
| 563 /** | 563 /** |
| 564 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a | 564 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a |
| 565 * compile-time error occurs. | 565 * compile-time error occurs. |
| 566 * | 566 * |
| 567 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 567 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 568 * deferred prefix. | 568 * deferred prefix. |
| 569 */ | 569 */ |
| 570 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FR OM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NO N_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', 24, "Constant values from a deferred li brary cannot be used to initialized a 'const' variable"); | 570 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FR OM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1("CONST_INITIALIZED_WITH_NO N_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY", 24, "Constant values from a deferred li brary cannot be used to initialized a 'const' variable"); |
| 571 | 571 |
| 572 /** | 572 /** |
| 573 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be | 573 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be |
| 574 * constant. | 574 * constant. |
| 575 */ | 575 */ |
| 576 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode.con1('CONST_INSTANCE_FIELD', 25, "Only static fields can be declared as 'c onst'"); | 576 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode.con1("CONST_INSTANCE_FIELD", 25, "Only static fields can be declared as 'c onst'"); |
| 577 | 577 |
| 578 /** | 578 /** |
| 579 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an | 579 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an |
| 580 * instance of a class that implements the operator <i>==</i> unless the key i s a string or | 580 * instance of a class that implements the operator <i>==</i> unless the key i s a string or |
| 581 * integer. | 581 * integer. |
| 582 */ | 582 */ |
| 583 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = const CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_ EQUALS', 26, "The constant map entry key expression type '%s' cannot override th e == operator"); | 583 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = const CompileTimeErrorCode.con1("CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_ EQUALS", 26, "The constant map entry key expression type '{0}' cannot override t he == operator"); |
| 584 | 584 |
| 585 /** | 585 /** |
| 586 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a | 586 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a |
| 587 * compile-time error occurs. | 587 * compile-time error occurs. |
| 588 * | 588 * |
| 589 * @param name the name of the uninitialized final variable | 589 * @param name the name of the uninitialized final variable |
| 590 */ | 590 */ |
| 591 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode.con1('CONST_NOT_INITIALIZED', 27, "The const variable '%s' must be initia lized"); | 591 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode.con1("CONST_NOT_INITIALIZED", 27, "The const variable '{0}' must be initi alized"); |
| 592 | 592 |
| 593 /** | 593 /** |
| 594 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2 | 594 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2 |
| 595 * are constant expressions that evaluate to a boolean value. | 595 * are constant expressions that evaluate to a boolean value. |
| 596 */ | 596 */ |
| 597 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode.con1('CONST_EVAL_TYPE_BOOL', 28, "An expression of type 'bool' was expecte d"); | 597 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode.con1("CONST_EVAL_TYPE_BOOL", 28, "An expression of type 'bool' was expecte d"); |
| 598 | 598 |
| 599 /** | 599 /** |
| 600 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are | 600 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are |
| 601 * constant expressions that evaluate to a numeric, string or boolean value or to null. | 601 * constant expressions that evaluate to a numeric, string or boolean value or to null. |
| 602 */ | 602 */ |
| 603 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const Comp ileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 29, "An expression of t ype 'bool', 'num', 'String' or 'null' was expected"); | 603 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const Comp ileTimeErrorCode.con1("CONST_EVAL_TYPE_BOOL_NUM_STRING", 29, "An expression of t ype 'bool', 'num', 'String' or 'null' was expected"); |
| 604 | 604 |
| 605 /** | 605 /** |
| 606 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1 | 606 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1 |
| 607 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to | 607 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to |
| 608 * null. | 608 * null. |
| 609 */ | 609 */ |
| 610 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code.con1('CONST_EVAL_TYPE_INT', 30, "An expression of type 'int' was expected") ; | 610 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code.con1("CONST_EVAL_TYPE_INT", 30, "An expression of type 'int' was expected") ; |
| 611 | 611 |
| 612 /** | 612 /** |
| 613 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/ | 613 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/ |
| 614 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant | 614 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant |
| 615 * expressions that evaluate to a numeric value or to null.. | 615 * expressions that evaluate to a numeric value or to null.. |
| 616 */ | 616 */ |
| 617 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code.con1('CONST_EVAL_TYPE_NUM', 31, "An expression of type 'num' was expected") ; | 617 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code.con1("CONST_EVAL_TYPE_NUM", 31, "An expression of type 'num' was expected") ; |
| 618 | 618 |
| 619 /** | 619 /** |
| 620 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 620 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 621 * uncaught exception being thrown. | 621 * uncaught exception being thrown. |
| 622 */ | 622 */ |
| 623 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 32, "Evaluation of this constan t expression causes exception"); | 623 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode.con1("CONST_EVAL_THROWS_EXCEPTION", 32, "Evaluation of this constan t expression causes exception"); |
| 624 | 624 |
| 625 /** | 625 /** |
| 626 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 626 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 627 * uncaught exception being thrown. | 627 * uncaught exception being thrown. |
| 628 */ | 628 */ |
| 629 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode.con1('CONST_EVAL_THROWS_IDBZE', 33, "Evaluation of this constant expres sion throws IntegerDivisionByZeroException"); | 629 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode.con1("CONST_EVAL_THROWS_IDBZE", 33, "Evaluation of this constant expres sion throws IntegerDivisionByZeroException"); |
| 630 | 630 |
| 631 /** | 631 /** |
| 632 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, & hellip;, | 632 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, & hellip;, |
| 633 * U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a | 633 * U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a |
| 634 * generic type with <i>m</i> type parameters. | 634 * generic type with <i>m</i> type parameters. |
| 635 * | 635 * |
| 636 * @param typeName the name of the type being referenced (<i>S</i>) | 636 * @param typeName the name of the type being referenced (<i>S</i>) |
| 637 * @param parameterCount the number of type parameters that were declared | 637 * @param parameterCount the number of type parameters that were declared |
| 638 * @param argumentCount the number of type arguments provided | 638 * @param argumentCount the number of type arguments provided |
| 639 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS | 639 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS |
| 640 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS | 640 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS |
| 641 */ | 641 */ |
| 642 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C ompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 34, "The type '%s ' is declared with %d type parameters, but %d type arguments were given"); | 642 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C ompileTimeErrorCode.con1("CONST_WITH_INVALID_TYPE_PARAMETERS", 34, "The type '{0 }' is declared with {1} type parameters, but {2} type arguments were given"); |
| 643 | 643 |
| 644 /** | 644 /** |
| 645 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>, | 645 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>, |
| 646 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a | 646 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a |
| 647 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same | 647 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same |
| 648 * name as the declaration of <i>T</i>. | 648 * name as the declaration of <i>T</i>. |
| 649 */ | 649 */ |
| 650 static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErro rCode.con1('CONST_WITH_NON_CONST', 35, "The constructor being called is not a 'c onst' constructor"); | 650 static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErro rCode.con1("CONST_WITH_NON_CONST", 35, "The constructor being called is not a 'c onst' constructor"); |
| 651 | 651 |
| 652 /** | 652 /** |
| 653 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1 | 653 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1 |
| 654 * <= i <= n + k</i>, is not a compile-time constant expression. | 654 * <= i <= n + k</i>, is not a compile-time constant expression. |
| 655 */ | 655 */ |
| 656 static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const Com pileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 36, "Arguments of a c onstant creation must be constant expressions"); | 656 static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const Com pileTimeErrorCode.con1("CONST_WITH_NON_CONSTANT_ARGUMENT", 36, "Arguments of a c onstant creation must be constant expressions"); |
| 657 | 657 |
| 658 /** | 658 /** |
| 659 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current | 659 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current |
| 660 * scope, optionally followed by type arguments. | 660 * scope, optionally followed by type arguments. |
| 661 * | 661 * |
| 662 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hel lip;, a<sub>n</sub>, | 662 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hel lip;, a<sub>n</sub>, |
| 663 * x<sub>n+1</sub>: a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub> )</i> it is a | 663 * x<sub>n+1</sub>: a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub> )</i> it is a |
| 664 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally | 664 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally |
| 665 * followed by type arguments. | 665 * followed by type arguments. |
| 666 * | 666 * |
| 667 * @param name the name of the non-type element | 667 * @param name the name of the non-type element |
| 668 */ | 668 */ |
| 669 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code.con1('CONST_WITH_NON_TYPE', 37, "The name '%s' is not a class"); | 669 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code.con1("CONST_WITH_NON_TYPE", 37, "The name '{0}' is not a class"); |
| 670 | 670 |
| 671 /** | 671 /** |
| 672 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters. | 672 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters. |
| 673 */ | 673 */ |
| 674 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 38, "The constant creation cannot use a type parameter"); | 674 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode.con1("CONST_WITH_TYPE_PARAMETERS", 38, "The constant creation cannot use a type parameter"); |
| 675 | 675 |
| 676 /** | 676 /** |
| 677 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant | 677 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant |
| 678 * constructor declared by the type <i>T</i>. | 678 * constructor declared by the type <i>T</i>. |
| 679 * | 679 * |
| 680 * @param typeName the name of the type | 680 * @param typeName the name of the type |
| 681 * @param constructorName the name of the requested constant constructor | 681 * @param constructorName the name of the requested constant constructor |
| 682 */ | 682 */ |
| 683 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const Com pileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 39, "The class '%s' d oes not have a constant constructor '%s'"); | 683 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const Com pileTimeErrorCode.con1("CONST_WITH_UNDEFINED_CONSTRUCTOR", 39, "The class '{0}' does not have a constant constructor '{1}'"); |
| 684 | 684 |
| 685 /** | 685 /** |
| 686 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant | 686 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant |
| 687 * constructor declared by the type <i>T</i>. | 687 * constructor declared by the type <i>T</i>. |
| 688 * | 688 * |
| 689 * @param typeName the name of the type | 689 * @param typeName the name of the type |
| 690 */ | 690 */ |
| 691 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = c onst CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 40, " The class '%s' does not have a default constant constructor"); | 691 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = c onst CompileTimeErrorCode.con1("CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT", 40, " The class '{0}' does not have a default constant constructor"); |
| 692 | 692 |
| 693 /** | 693 /** |
| 694 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature | 694 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature |
| 695 * of a function type alias. | 695 * of a function type alias. |
| 696 */ | 696 */ |
| 697 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 41, "Default values aren't allowed in typedefs"); | 697 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1("DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS", 41, "Default values aren't allowed in typedefs"); |
| 698 | 698 |
| 699 /** | 699 /** |
| 700 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes | 700 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes |
| 701 * its type as a function type. It is a compile-time error if any default valu es are specified in | 701 * its type as a function type. It is a compile-time error if any default valu es are specified in |
| 702 * the signature of such a function type. | 702 * the signature of such a function type. |
| 703 */ | 703 */ |
| 704 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 42, "Default values aren't allowed in function type parameters"); | 704 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1("DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER", 42, "Default values aren't allowed in function type parameters"); |
| 705 | 705 |
| 706 /** | 706 /** |
| 707 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value | 707 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value |
| 708 * for an optional parameter. | 708 * for an optional parameter. |
| 709 */ | 709 */ |
| 710 static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CON STRUCTOR', 43, "Default values aren't allowed in factory constructors that redir ect to another constructor"); | 710 static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = const CompileTimeErrorCode.con1("DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CON STRUCTOR", 43, "Default values aren't allowed in factory constructors that redir ect to another constructor"); |
| 711 | 711 |
| 712 /** | 712 /** |
| 713 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name | 713 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name |
| 714 * declared in the same scope. | 714 * declared in the same scope. |
| 715 */ | 715 */ |
| 716 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 44, "The default constructo r is already defined"); | 716 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode.con1("DUPLICATE_CONSTRUCTOR_DEFAULT", 44, "The default constructo r is already defined"); |
| 717 | 717 |
| 718 /** | 718 /** |
| 719 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name | 719 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name |
| 720 * declared in the same scope. | 720 * declared in the same scope. |
| 721 * | 721 * |
| 722 * @param duplicateName the name of the duplicate entity | 722 * @param duplicateName the name of the duplicate entity |
| 723 */ | 723 */ |
| 724 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 45, "The constructor with name '% s' is already defined"); | 724 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode.con1("DUPLICATE_CONSTRUCTOR_NAME", 45, "The constructor with name '{ 0}' is already defined"); |
| 725 | 725 |
| 726 /** | 726 /** |
| 727 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name | 727 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name |
| 728 * declared in the same scope. | 728 * declared in the same scope. |
| 729 * | 729 * |
| 730 * 7 Classes: It is a compile-time error if a class declares two members of th e same name. | 730 * 7 Classes: It is a compile-time error if a class declares two members of th e same name. |
| 731 * | 731 * |
| 732 * 7 Classes: It is a compile-time error if a class has an instance member and a static member | 732 * 7 Classes: It is a compile-time error if a class has an instance member and a static member |
| 733 * with the same name. | 733 * with the same name. |
| 734 * | 734 * |
| 735 * @param duplicateName the name of the duplicate entity | 735 * @param duplicateName the name of the duplicate entity |
| 736 */ | 736 */ |
| 737 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode.con1('DUPLICATE_DEFINITION', 46, "The name '%s' is already defined"); | 737 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode.con1("DUPLICATE_DEFINITION", 46, "The name '{0}' is already defined"); |
| 738 | 738 |
| 739 /** | 739 /** |
| 740 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member | 740 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member |
| 741 * with the same name. | 741 * with the same name. |
| 742 * | 742 * |
| 743 * This covers the additional duplicate definition cases where inheritance has to be considered. | 743 * This covers the additional duplicate definition cases where inheritance has to be considered. |
| 744 * | 744 * |
| 745 * @param className the name of the class that has conflicting instance/static members | 745 * @param className the name of the class that has conflicting instance/static members |
| 746 * @param name the name of the conflicting members | 746 * @param name the name of the conflicting members |
| 747 * @see #DUPLICATE_DEFINITION | 747 * @see #DUPLICATE_DEFINITION |
| 748 */ | 748 */ |
| 749 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 47, "The name '%s' is already defined in '%s'"); | 749 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode.con1("DUPLICATE_DEFINITION_INHERITANCE", 47, "The name '{0}' i s already defined in '{1}'"); |
| 750 | 750 |
| 751 /** | 751 /** |
| 752 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> = | 752 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> = |
| 753 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named | 753 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named |
| 754 * argument]. | 754 * argument]. |
| 755 */ | 755 */ |
| 756 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime ErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 48, "The argument for the named param eter '%s' was already specified"); | 756 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime ErrorCode.con1("DUPLICATE_NAMED_ARGUMENT", 48, "The argument for the named param eter '{0}' was already specified"); |
| 757 | 757 |
| 758 /** | 758 /** |
| 759 * SDK implementation libraries can be exported only by other SDK libraries. | 759 * SDK implementation libraries can be exported only by other SDK libraries. |
| 760 * | 760 * |
| 761 * @param uri the uri pointing to a library | 761 * @param uri the uri pointing to a library |
| 762 */ | 762 */ |
| 763 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('EXPORT_INTERNAL_LIBRARY', 49, "The library '%s' is internal and c annot be exported"); | 763 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1("EXPORT_INTERNAL_LIBRARY", 49, "The library '{0}' is internal and cannot be exported"); |
| 764 | 764 |
| 765 /** | 765 /** |
| 766 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is | 766 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is |
| 767 * not a library declaration. | 767 * not a library declaration. |
| 768 * | 768 * |
| 769 * @param uri the uri pointing to a non-library declaration | 769 * @param uri the uri pointing to a non-library declaration |
| 770 */ | 770 */ |
| 771 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('EXPORT_OF_NON_LIBRARY', 50, "The exported library '%s' must not hav e a part-of directive"); | 771 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1("EXPORT_OF_NON_LIBRARY", 50, "The exported library '{0}' must not ha ve a part-of directive"); |
| 772 | 772 |
| 773 /** | 773 /** |
| 774 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. | 774 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. |
| 775 */ | 775 */ |
| 776 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode.co n1('EXTENDS_ENUM', 51, "Classes cannot extend an enum"); | 776 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode.co n1("EXTENDS_ENUM", 51, "Classes cannot extend an enum"); |
| 777 | 777 |
| 778 /** | 778 /** |
| 779 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes | 779 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes |
| 780 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>. | 780 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>. |
| 781 * | 781 * |
| 782 * @param typeName the name of the superclass that was not found | 782 * @param typeName the name of the superclass that was not found |
| 783 */ | 783 */ |
| 784 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de.con1('EXTENDS_NON_CLASS', 52, "Classes can only extend other classes"); | 784 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de.con1("EXTENDS_NON_CLASS", 52, "Classes can only extend other classes"); |
| 785 | 785 |
| 786 /** | 786 /** |
| 787 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. | 787 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. |
| 788 * | 788 * |
| 789 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. | 789 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. |
| 790 * | 790 * |
| 791 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. | 791 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. |
| 792 * | 792 * |
| 793 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to | 793 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to |
| 794 * attempt to extend or implement num. | 794 * attempt to extend or implement num. |
| 795 * | 795 * |
| 796 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. | 796 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. |
| 797 * | 797 * |
| 798 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. | 798 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. |
| 799 * | 799 * |
| 800 * @param typeName the name of the type that cannot be extended | 800 * @param typeName the name of the type that cannot be extended |
| 801 * @see #IMPLEMENTS_DISALLOWED_CLASS | 801 * @see #IMPLEMENTS_DISALLOWED_CLASS |
| 802 */ | 802 */ |
| 803 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 53, "Classes cannot extend '%s'"); | 803 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode.con1("EXTENDS_DISALLOWED_CLASS", 53, "Classes cannot extend '{0}'"); |
| 804 | 804 |
| 805 /** | 805 /** |
| 806 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes | 806 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes |
| 807 * a deferred type expression. | 807 * a deferred type expression. |
| 808 * | 808 * |
| 809 * @param typeName the name of the type that cannot be extended | 809 * @param typeName the name of the type that cannot be extended |
| 810 * @see #IMPLEMENTS_DEFERRED_CLASS | 810 * @see #IMPLEMENTS_DEFERRED_CLASS |
| 811 * @see #MIXIN_DEFERRED_CLASS | 811 * @see #MIXIN_DEFERRED_CLASS |
| 812 */ | 812 */ |
| 813 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr rorCode.con1('EXTENDS_DEFERRED_CLASS', 54, "This class cannot extend the deferre d class '%s'"); | 813 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr rorCode.con1("EXTENDS_DEFERRED_CLASS", 54, "This class cannot extend the deferre d class '{0}'"); |
| 814 | 814 |
| 815 /** | 815 /** |
| 816 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</ i> or if <i>m > | 816 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</ i> or if <i>m > |
| 817 * n</i>. | 817 * n</i>. |
| 818 * | 818 * |
| 819 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 819 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 820 * uncaught exception being thrown. | 820 * uncaught exception being thrown. |
| 821 * | 821 * |
| 822 * @param requiredCount the maximum number of positional arguments | 822 * @param requiredCount the maximum number of positional arguments |
| 823 * @param argumentCount the actual number of positional arguments given | 823 * @param argumentCount the actual number of positional arguments given |
| 824 */ | 824 */ |
| 825 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 55, "%d positional arguments expe cted, but %d found"); | 825 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode.con1("EXTRA_POSITIONAL_ARGUMENTS", 55, "{0} positional arguments exp ected, but {1} found"); |
| 826 | 826 |
| 827 /** | 827 /** |
| 828 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time | 828 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time |
| 829 * error if more than one initializer corresponding to a given instance variab le appears in | 829 * error if more than one initializer corresponding to a given instance variab le appears in |
| 830 * <i>k</i>'s list. | 830 * <i>k</i>'s list. |
| 831 */ | 831 */ |
| 832 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 5 6, "The field '%s' cannot be initialized twice in the same constructor"); | 832 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1("FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS", 5 6, "The field '{0}' cannot be initialized twice in the same constructor"); |
| 833 | 833 |
| 834 /** | 834 /** |
| 835 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time | 835 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time |
| 836 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized | 836 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized |
| 837 * by means of an initializing formal of <i>k</i>. | 837 * by means of an initializing formal of <i>k</i>. |
| 838 */ | 838 */ |
| 839 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIAL IZER', 57, "Fields cannot be initialized in both the parameter list and the init ializers"); | 839 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = const CompileTimeErrorCode.con1("FIELD_INITIALIZED_IN_PARAMETER_AND_INITIAL IZER", 57, "Fields cannot be initialized in both the parameter list and the init ializers"); |
| 840 | 840 |
| 841 /** | 841 /** |
| 842 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by | 842 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by |
| 843 * means of an initializing formal of a constructor is also initialized elsewh ere in the same | 843 * means of an initializing formal of a constructor is also initialized elsewh ere in the same |
| 844 * constructor. | 844 * constructor. |
| 845 * | 845 * |
| 846 * @param name the name of the field in question | 846 * @param name the name of the field in question |
| 847 */ | 847 */ |
| 848 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const Com pileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 58, "'%s' is a final field and so can only be set once"); | 848 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const Com pileTimeErrorCode.con1("FINAL_INITIALIZED_MULTIPLE_TIMES", 58, "'{0}' is a final field and so can only be set once"); |
| 849 | 849 |
| 850 /** | 850 /** |
| 851 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by | 851 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by |
| 852 * a function other than a non-redirecting generative constructor. | 852 * a function other than a non-redirecting generative constructor. |
| 853 */ | 853 */ |
| 854 static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 59, "Initia lizing formal fields cannot be used in factory constructors"); | 854 static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = cons t CompileTimeErrorCode.con1("FIELD_INITIALIZER_FACTORY_CONSTRUCTOR", 59, "Initia lizing formal fields cannot be used in factory constructors"); |
| 855 | 855 |
| 856 /** | 856 /** |
| 857 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by | 857 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by |
| 858 * a function other than a non-redirecting generative constructor. | 858 * a function other than a non-redirecting generative constructor. |
| 859 */ | 859 */ |
| 860 static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 60, "Initia lizing formal fields can only be used in constructors"); | 860 static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = cons t CompileTimeErrorCode.con1("FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR", 60, "Initia lizing formal fields can only be used in constructors"); |
| 861 | 861 |
| 862 /** | 862 /** |
| 863 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its | 863 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its |
| 864 * only action is to invoke another generative constructor. | 864 * only action is to invoke another generative constructor. |
| 865 * | 865 * |
| 866 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by | 866 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by |
| 867 * a function other than a non-redirecting generative constructor. | 867 * a function other than a non-redirecting generative constructor. |
| 868 */ | 868 */ |
| 869 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 61, "The redirecting constructor cannot have a field initializer"); | 869 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1("FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR", 61, "The redirecting constructor cannot have a field initializer"); |
| 870 | 870 |
| 871 /** | 871 /** |
| 872 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same | 872 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same |
| 873 * name. | 873 * name. |
| 874 * | 874 * |
| 875 * @param name the conflicting name of the getter and method | 875 * @param name the conflicting name of the getter and method |
| 876 */ | 876 */ |
| 877 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 62, "'%s' cannot be u sed to name a getter, there is already a method with the same name"); | 877 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com pileTimeErrorCode.con1("GETTER_AND_METHOD_WITH_SAME_NAME", 62, "'{0}' cannot be used to name a getter, there is already a method with the same name"); |
| 878 | 878 |
| 879 /** | 879 /** |
| 880 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> | 880 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> |
| 881 * specifies a malformed type or deferred type as a superinterface. | 881 * specifies a malformed type or deferred type as a superinterface. |
| 882 * | 882 * |
| 883 * @param typeName the name of the type that cannot be extended | 883 * @param typeName the name of the type that cannot be extended |
| 884 * @see #EXTENDS_DEFERRED_CLASS | 884 * @see #EXTENDS_DEFERRED_CLASS |
| 885 * @see #MIXIN_DEFERRED_CLASS | 885 * @see #MIXIN_DEFERRED_CLASS |
| 886 */ | 886 */ |
| 887 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim eErrorCode.con1('IMPLEMENTS_DEFERRED_CLASS', 63, "This class cannot implement th e deferred class '%s'"); | 887 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim eErrorCode.con1("IMPLEMENTS_DEFERRED_CLASS", 63, "This class cannot implement th e deferred class '{0}'"); |
| 888 | 888 |
| 889 /** | 889 /** |
| 890 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. | 890 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. |
| 891 * | 891 * |
| 892 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. | 892 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. |
| 893 * | 893 * |
| 894 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. | 894 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. |
| 895 * | 895 * |
| 896 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to | 896 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to |
| 897 * attempt to extend or implement num. | 897 * attempt to extend or implement num. |
| 898 * | 898 * |
| 899 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. | 899 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. |
| 900 * | 900 * |
| 901 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. | 901 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. |
| 902 * | 902 * |
| 903 * @param typeName the name of the type that cannot be implemented | 903 * @param typeName the name of the type that cannot be implemented |
| 904 * @see #EXTENDS_DISALLOWED_CLASS | 904 * @see #EXTENDS_DISALLOWED_CLASS |
| 905 */ | 905 */ |
| 906 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 64, "Classes cannot implement ' %s'"); | 906 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode.con1("IMPLEMENTS_DISALLOWED_CLASS", 64, "Classes cannot implement ' {0}'"); |
| 907 | 907 |
| 908 /** | 908 /** |
| 909 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes | 909 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes |
| 910 * type dynamic. | 910 * type dynamic. |
| 911 */ | 911 */ |
| 912 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode.con1('IMPLEMENTS_DYNAMIC', 65, "Classes cannot implement 'dynamic'"); | 912 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode.con1("IMPLEMENTS_DYNAMIC", 65, "Classes cannot implement 'dynamic'"); |
| 913 | 913 |
| 914 /** | 914 /** |
| 915 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. | 915 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. |
| 916 */ | 916 */ |
| 917 static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode .con1('IMPLEMENTS_ENUM', 66, "Classes cannot implement an enum"); | 917 static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode .con1("IMPLEMENTS_ENUM", 66, "Classes cannot implement an enum"); |
| 918 | 918 |
| 919 /** | 919 /** |
| 920 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> | 920 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> |
| 921 * includes a type expression that does not denote a class available in the le xical scope of | 921 * includes a type expression that does not denote a class available in the le xical scope of |
| 922 * <i>C</i>. | 922 * <i>C</i>. |
| 923 * | 923 * |
| 924 * @param typeName the name of the interface that was not found | 924 * @param typeName the name of the interface that was not found |
| 925 */ | 925 */ |
| 926 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode.con1('IMPLEMENTS_NON_CLASS', 67, "Classes can only implement other classes "); | 926 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode.con1("IMPLEMENTS_NON_CLASS", 67, "Classes can only implement other classes "); |
| 927 | 927 |
| 928 /** | 928 /** |
| 929 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in | 929 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in |
| 930 * the implements clause of a class. | 930 * the implements clause of a class. |
| 931 * | 931 * |
| 932 * @param className the name of the class that is implemented more than once | 932 * @param className the name of the class that is implemented more than once |
| 933 */ | 933 */ |
| 934 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code.con1('IMPLEMENTS_REPEATED', 68, "'%s' can only be implemented once"); | 934 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code.con1("IMPLEMENTS_REPEATED", 68, "'{0}' can only be implemented once"); |
| 935 | 935 |
| 936 /** | 936 /** |
| 937 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears | 937 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears |
| 938 * in the implements clause of <i>C</i>. | 938 * in the implements clause of <i>C</i>. |
| 939 * | 939 * |
| 940 * @param className the name of the class that appears in both "extends" and " implements" clauses | 940 * @param className the name of the class that appears in both "extends" and " implements" clauses |
| 941 */ | 941 */ |
| 942 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeEr rorCode.con1('IMPLEMENTS_SUPER_CLASS', 69, "'%s' cannot be used in both 'extends ' and 'implements' clauses"); | 942 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeEr rorCode.con1("IMPLEMENTS_SUPER_CLASS", 69, "'{0}' cannot be used in both 'extend s' and 'implements' clauses"); |
| 943 | 943 |
| 944 /** | 944 /** |
| 945 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of | 945 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of |
| 946 * an initializer. | 946 * an initializer. |
| 947 * | 947 * |
| 948 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable | 948 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable |
| 949 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the | 949 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the |
| 950 * initializer of an instance variable. | 950 * initializer of an instance variable. |
| 951 * | 951 * |
| 952 * @param name the name of the type in question | 952 * @param name the name of the type in question |
| 953 */ | 953 */ |
| 954 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = con st CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 70, "Only static members can be accessed in initializers"); | 954 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = con st CompileTimeErrorCode.con1("IMPLICIT_THIS_REFERENCE_IN_INITIALIZER", 70, "Only static members can be accessed in initializers"); |
| 955 | 955 |
| 956 /** | 956 /** |
| 957 * SDK implementation libraries can be imported only by other SDK libraries. | 957 * SDK implementation libraries can be imported only by other SDK libraries. |
| 958 * | 958 * |
| 959 * @param uri the uri pointing to a library | 959 * @param uri the uri pointing to a library |
| 960 */ | 960 */ |
| 961 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('IMPORT_INTERNAL_LIBRARY', 71, "The library '%s' is internal and c annot be imported"); | 961 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1("IMPORT_INTERNAL_LIBRARY", 71, "The library '{0}' is internal and cannot be imported"); |
| 962 | 962 |
| 963 /** | 963 /** |
| 964 * 14.1 Imports: It is a compile-time error if the specified URI of an immedia te import does not | 964 * 14.1 Imports: It is a compile-time error if the specified URI of an immedia te import does not |
| 965 * refer to a library declaration. | 965 * refer to a library declaration. |
| 966 * | 966 * |
| 967 * @param uri the uri pointing to a non-library declaration | 967 * @param uri the uri pointing to a non-library declaration |
| 968 * @see StaticWarningCode#IMPORT_OF_NON_LIBRARY | 968 * @see StaticWarningCode#IMPORT_OF_NON_LIBRARY |
| 969 */ | 969 */ |
| 970 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('IMPORT_OF_NON_LIBRARY', 72, "The imported library '%s' must not hav e a part-of directive"); | 970 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1("IMPORT_OF_NON_LIBRARY", 72, "The imported library '{0}' must not ha ve a part-of directive"); |
| 971 | 971 |
| 972 /** | 972 /** |
| 973 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are | 973 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are |
| 974 * not instances of the same class <i>C</i>, for all <i>1 <= k <= n</i>. | 974 * not instances of the same class <i>C</i>, for all <i>1 <= k <= n</i>. |
| 975 * | 975 * |
| 976 * @param expressionSource the expression source code that is the unexpected t ype | 976 * @param expressionSource the expression source code that is the unexpected t ype |
| 977 * @param expectedType the name of the expected type | 977 * @param expectedType the name of the expected type |
| 978 */ | 978 */ |
| 979 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C ompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 73, "Case express ions must have the same types, '%s' is not a '%s'"); | 979 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C ompileTimeErrorCode.con1("INCONSISTENT_CASE_EXPRESSION_TYPES", 73, "Case express ions must have the same types, '{0}' is not a '{1}'"); |
| 980 | 980 |
| 981 /** | 981 /** |
| 982 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time | 982 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time |
| 983 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an | 983 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an |
| 984 * instance variable declared in the immediately surrounding class. | 984 * instance variable declared in the immediately surrounding class. |
| 985 * | 985 * |
| 986 * @param id the name of the initializing formal that is not an instance varia ble in the | 986 * @param id the name of the initializing formal that is not an instance varia ble in the |
| 987 * immediately enclosing class | 987 * immediately enclosing class |
| 988 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD | 988 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD |
| 989 */ | 989 */ |
| 990 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = const C ompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 74, "'%s' is not a variable in the enclosing class"); | 990 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = const C ompileTimeErrorCode.con1("INITIALIZER_FOR_NON_EXISTANT_FIELD", 74, "'{0}' is not a variable in the enclosing class"); |
| 991 | 991 |
| 992 /** | 992 /** |
| 993 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time | 993 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time |
| 994 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an | 994 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an |
| 995 * instance variable declared in the immediately surrounding class. | 995 * instance variable declared in the immediately surrounding class. |
| 996 * | 996 * |
| 997 * @param id the name of the initializing formal that is a static variable in the immediately | 997 * @param id the name of the initializing formal that is a static variable in the immediately |
| 998 * enclosing class | 998 * enclosing class |
| 999 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD | 999 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD |
| 1000 */ | 1000 */ |
| 1001 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile TimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 75, "'%s' is a static variabl e in the enclosing class, variables initialized in a constructor cannot be stati c"); | 1001 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile TimeErrorCode.con1("INITIALIZER_FOR_STATIC_FIELD", 75, "'{0}' is a static variab le in the enclosing class, variables initialized in a constructor cannot be stat ic"); |
| 1002 | 1002 |
| 1003 /** | 1003 /** |
| 1004 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a | 1004 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a |
| 1005 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately | 1005 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately |
| 1006 * enclosing class. | 1006 * enclosing class. |
| 1007 * | 1007 * |
| 1008 * @param id the name of the initializing formal that is not an instance varia ble in the | 1008 * @param id the name of the initializing formal that is not an instance varia ble in the |
| 1009 * immediately enclosing class | 1009 * immediately enclosing class |
| 1010 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD | 1010 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD |
| 1011 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD | 1011 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD |
| 1012 */ | 1012 */ |
| 1013 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 7 6, "'%s' is not a variable in the enclosing class"); | 1013 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1("INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD", 7 6, "'{0}' is not a variable in the enclosing class"); |
| 1014 | 1014 |
| 1015 /** | 1015 /** |
| 1016 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a | 1016 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a |
| 1017 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately | 1017 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately |
| 1018 * enclosing class. | 1018 * enclosing class. |
| 1019 * | 1019 * |
| 1020 * @param id the name of the initializing formal that is a static variable in the immediately | 1020 * @param id the name of the initializing formal that is a static variable in the immediately |
| 1021 * enclosing class | 1021 * enclosing class |
| 1022 * @see #INITIALIZER_FOR_STATIC_FIELD | 1022 * @see #INITIALIZER_FOR_STATIC_FIELD |
| 1023 */ | 1023 */ |
| 1024 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 77, "'%s' is a static field in the enclosing class, fields initialized in a constructor canno t be static"); | 1024 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1("INITIALIZING_FORMAL_FOR_STATIC_FIELD", 77, "'{0}' is a static field in the enclosing class, fields initialized in a constructor cann ot be static"); |
| 1025 | 1025 |
| 1026 /** | 1026 /** |
| 1027 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action | 1027 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action |
| 1028 * <b>this</b>.<i>id</i>. | 1028 * <b>this</b>.<i>id</i>. |
| 1029 */ | 1029 */ |
| 1030 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', 78, "Instance m embers cannot be accessed from a factory constructor"); | 1030 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode.con1("INSTANCE_MEMBER_ACCESS_FROM_FACTORY", 78, "Instance m embers cannot be accessed from a factory constructor"); |
| 1031 | 1031 |
| 1032 /** | 1032 /** |
| 1033 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action | 1033 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action |
| 1034 * <b>this</b>.<i>id</i>. | 1034 * <b>this</b>.<i>id</i>. |
| 1035 */ | 1035 */ |
| 1036 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 79, "Instance mem bers cannot be accessed from a static method"); | 1036 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1("INSTANCE_MEMBER_ACCESS_FROM_STATIC", 79, "Instance mem bers cannot be accessed from a static method"); |
| 1037 | 1037 |
| 1038 /** | 1038 /** |
| 1039 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or | 1039 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or |
| 1040 * 'const' or to access its private fields. | 1040 * 'const' or to access its private fields. |
| 1041 */ | 1041 */ |
| 1042 static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCod e.con1('INSTANTIATE_ENUM', 80, "Enums cannot be instantiated"); | 1042 static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCod e.con1("INSTANTIATE_ENUM", 80, "Enums cannot be instantiated"); |
| 1043 | 1043 |
| 1044 /** | 1044 /** |
| 1045 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the | 1045 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the |
| 1046 * character @, followed by a constant expression that must be either a refere nce to a | 1046 * character @, followed by a constant expression that must be either a refere nce to a |
| 1047 * compile-time constant variable, or a call to a constant constructor. | 1047 * compile-time constant variable, or a call to a constant constructor. |
| 1048 */ | 1048 */ |
| 1049 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 81, "Annotation can be only constant variable or constant constructor invocation"); | 1049 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1("INVALID_ANNOTATION", 81, "Annotation can be only constant variable or constant constructor invocation"); |
| 1050 | 1050 |
| 1051 /** | 1051 /** |
| 1052 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the | 1052 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the |
| 1053 * character @, followed by a constant expression that must be either a refere nce to a | 1053 * character @, followed by a constant expression that must be either a refere nce to a |
| 1054 * compile-time constant variable, or a call to a constant constructor. | 1054 * compile-time constant variable, or a call to a constant constructor. |
| 1055 * | 1055 * |
| 1056 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1056 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1057 * deferred prefix. | 1057 * deferred prefix. |
| 1058 */ | 1058 */ |
| 1059 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode.con1('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', 82, " Constant values from a deferred library cannot be used as annotations"); | 1059 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode.con1("INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY", 82, " Constant values from a deferred library cannot be used as annotations"); |
| 1060 | 1060 |
| 1061 /** | 1061 /** |
| 1062 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time | 1062 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time |
| 1063 * constants. Until then, this acts as a placeholder for more informative erro rs. | 1063 * constants. Until then, this acts as a placeholder for more informative erro rs. |
| 1064 * | 1064 * |
| 1065 * See TODOs in ConstantVisitor | 1065 * See TODOs in ConstantVisitor |
| 1066 */ | 1066 */ |
| 1067 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 83, "Invalid constant value"); | 1067 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1("INVALID_CONSTANT", 83, "Invalid constant value"); |
| 1068 | 1068 |
| 1069 /** | 1069 /** |
| 1070 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor | 1070 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor |
| 1071 * name. | 1071 * name. |
| 1072 */ | 1072 */ |
| 1073 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 84, "Invalid constructor name"); | 1073 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1("INVALID_CONSTRUCTOR_NAME", 84, "Invalid constructor name"); |
| 1074 | 1074 |
| 1075 /** | 1075 /** |
| 1076 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately | 1076 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately |
| 1077 * enclosing class. | 1077 * enclosing class. |
| 1078 */ | 1078 */ |
| 1079 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 85, "The name of the immediately enclosing class expected"); | 1079 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1("INVALID_FACTORY_NAME_NOT_A_CLASS", 85, "The name of the immediately enclosing class expected"); |
| 1080 | 1080 |
| 1081 /** | 1081 /** |
| 1082 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable | 1082 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable |
| 1083 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the | 1083 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the |
| 1084 * initializer of an instance variable. | 1084 * initializer of an instance variable. |
| 1085 */ | 1085 */ |
| 1086 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 86, "Invalid reference to 'this' ex pression"); | 1086 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1("INVALID_REFERENCE_TO_THIS", 86, "Invalid reference to 'this' ex pression"); |
| 1087 | 1087 |
| 1088 /** | 1088 /** |
| 1089 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes | 1089 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes |
| 1090 * a type parameter. | 1090 * a type parameter. |
| 1091 * | 1091 * |
| 1092 * @name the name of the type parameter | 1092 * @name the name of the type parameter |
| 1093 */ | 1093 */ |
| 1094 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 87, "Constant l ist literals cannot include a type parameter as a type argument, such as '%s'"); | 1094 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1("INVALID_TYPE_ARGUMENT_IN_CONST_LIST", 87, "Constant l ist literals cannot include a type parameter as a type argument, such as '{0}'") ; |
| 1095 | 1095 |
| 1096 /** | 1096 /** |
| 1097 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a | 1097 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a |
| 1098 * type parameter. | 1098 * type parameter. |
| 1099 * | 1099 * |
| 1100 * @name the name of the type parameter | 1100 * @name the name of the type parameter |
| 1101 */ | 1101 */ |
| 1102 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 88, "Constant map literals cannot include a type parameter as a type argument, such as '%s'"); | 1102 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1("INVALID_TYPE_ARGUMENT_IN_CONST_MAP", 88, "Constant map literals cannot include a type parameter as a type argument, such as '{0}'"); |
| 1103 | 1103 |
| 1104 /** | 1104 /** |
| 1105 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is | 1105 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is |
| 1106 * not a library declaration. | 1106 * not a library declaration. |
| 1107 * | 1107 * |
| 1108 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is | 1108 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is |
| 1109 * not a library declaration. | 1109 * not a library declaration. |
| 1110 * | 1110 * |
| 1111 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part | 1111 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part |
| 1112 * declaration. | 1112 * declaration. |
| 1113 * | 1113 * |
| 1114 * @param uri the URI that is invalid | 1114 * @param uri the URI that is invalid |
| 1115 * @see #URI_DOES_NOT_EXIST | 1115 * @see #URI_DOES_NOT_EXIST |
| 1116 */ | 1116 */ |
| 1117 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 89, "Invalid URI syntax: '%s'"); | 1117 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1("INVALID_URI", 89, "Invalid URI syntax: '{0}'"); |
| 1118 | 1118 |
| 1119 /** | 1119 /** |
| 1120 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within | 1120 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within |
| 1121 * the innermost function in which <i>s<sub>b</sub></i> occurs. | 1121 * the innermost function in which <i>s<sub>b</sub></i> occurs. |
| 1122 * | 1122 * |
| 1123 * 13.14 Continue: It is a compile-time error if no such statement or case cla use | 1123 * 13.14 Continue: It is a compile-time error if no such statement or case cla use |
| 1124 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. | 1124 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. |
| 1125 * | 1125 * |
| 1126 * @param labelName the name of the unresolvable label | 1126 * @param labelName the name of the unresolvable label |
| 1127 */ | 1127 */ |
| 1128 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1('LABEL_IN_OUTER_SCOPE', 90, "Cannot reference label '%s' declared in an outer method"); | 1128 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1("LABEL_IN_OUTER_SCOPE", 90, "Cannot reference label '{0}' declared in an outer method"); |
| 1129 | 1129 |
| 1130 /** | 1130 /** |
| 1131 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within | 1131 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within |
| 1132 * the innermost function in which <i>s<sub>b</sub></i> occurs. | 1132 * the innermost function in which <i>s<sub>b</sub></i> occurs. |
| 1133 * | 1133 * |
| 1134 * 13.14 Continue: It is a compile-time error if no such statement or case cla use | 1134 * 13.14 Continue: It is a compile-time error if no such statement or case cla use |
| 1135 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. | 1135 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. |
| 1136 * | 1136 * |
| 1137 * @param labelName the name of the unresolvable label | 1137 * @param labelName the name of the unresolvable label |
| 1138 */ | 1138 */ |
| 1139 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 91, "Cannot reference undefined label '%s'"); | 1139 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1("LABEL_UNDEFINED", 91, "Cannot reference undefined label '{0}'"); |
| 1140 | 1140 |
| 1141 /** | 1141 /** |
| 1142 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i> ... | 1142 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i> ... |
| 1143 * <i>e<sub>n</sub></i>] is evaluated as follows: | 1143 * <i>e<sub>n</sub></i>] is evaluated as follows: |
| 1144 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument | 1144 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument |
| 1145 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> | 1145 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> |
| 1146 * | 1146 * |
| 1147 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 1147 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 1148 * <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 <= | 1148 * <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 <= |
| 1149 * 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>. | 1149 * 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>. |
| 1150 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 1150 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 1151 * j <= m</i>. | 1151 * j <= m</i>. |
| 1152 */ | 1152 */ |
| 1153 static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Com pileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 92, "The element type '%s' cannot be assigned to the list type '%s'"); | 1153 static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Com pileTimeErrorCode.con1("LIST_ELEMENT_TYPE_NOT_ASSIGNABLE", 92, "The element type '{0}' cannot be assigned to the list type '{1}'"); |
| 1154 | 1154 |
| 1155 /** | 1155 /** |
| 1156 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : | 1156 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : |
| 1157 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: | 1157 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: |
| 1158 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second | 1158 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second |
| 1159 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 1159 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
| 1160 * | 1160 * |
| 1161 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 1161 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 1162 * <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 <= | 1162 * <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 <= |
| 1163 * 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>. | 1163 * 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>. |
| 1164 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 1164 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 1165 * j <= m</i>. | 1165 * j <= m</i>. |
| 1166 */ | 1166 */ |
| 1167 static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileT imeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 93, "The element type '%s' cann ot be assigned to the map key type '%s'"); | 1167 static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileT imeErrorCode.con1("MAP_KEY_TYPE_NOT_ASSIGNABLE", 93, "The element type '{0}' can not be assigned to the map key type '{1}'"); |
| 1168 | 1168 |
| 1169 /** | 1169 /** |
| 1170 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : | 1170 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : |
| 1171 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: | 1171 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: |
| 1172 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second | 1172 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second |
| 1173 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 1173 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
| 1174 * | 1174 * |
| 1175 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 1175 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 1176 * <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 <= | 1176 * <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 <= |
| 1177 * 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>. | 1177 * 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>. |
| 1178 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 1178 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 1179 * j <= m</i>. | 1179 * j <= m</i>. |
| 1180 */ | 1180 */ |
| 1181 static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const Compil eTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 94, "The element type '%s' cannot be assigned to the map value type '%s'"); | 1181 static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const Compil eTimeErrorCode.con1("MAP_VALUE_TYPE_NOT_ASSIGNABLE", 94, "The element type '{0}' cannot be assigned to the map value type '{1}'"); |
| 1182 | 1182 |
| 1183 /** | 1183 /** |
| 1184 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name | 1184 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name |
| 1185 * as <i>C</i>. | 1185 * as <i>C</i>. |
| 1186 */ | 1186 */ |
| 1187 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1('MEMBER_WITH_CLASS_NAME', 95, "Class members cannot have the same n ame as the enclosing class"); | 1187 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1("MEMBER_WITH_CLASS_NAME", 95, "Class members cannot have the same n ame as the enclosing class"); |
| 1188 | 1188 |
| 1189 /** | 1189 /** |
| 1190 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same | 1190 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same |
| 1191 * name. | 1191 * name. |
| 1192 * | 1192 * |
| 1193 * @param name the conflicting name of the getter and method | 1193 * @param name the conflicting name of the getter and method |
| 1194 */ | 1194 */ |
| 1195 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 96, "'%s' cannot be u sed to name a method, there is already a getter with the same name"); | 1195 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1("METHOD_AND_GETTER_WITH_SAME_NAME", 96, "'{0}' cannot be used to name a method, there is already a getter with the same name"); |
| 1196 | 1196 |
| 1197 /** | 1197 /** |
| 1198 * 12.1 Constants: A constant expression is ... a constant list literal. | 1198 * 12.1 Constants: A constant expression is ... a constant list literal. |
| 1199 */ | 1199 */ |
| 1200 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 97, "List literals must be prefixed with 'const' when used as a constant expression"); | 1200 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1("MISSING_CONST_IN_LIST_LITERAL", 97, "List literals must be prefixed with 'const' when used as a constant expression"); |
| 1201 | 1201 |
| 1202 /** | 1202 /** |
| 1203 * 12.1 Constants: A constant expression is ... a constant map literal. | 1203 * 12.1 Constants: A constant expression is ... a constant map literal. |
| 1204 */ | 1204 */ |
| 1205 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 98, "Map literals must be pre fixed with 'const' when used as a constant expression"); | 1205 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1("MISSING_CONST_IN_MAP_LITERAL", 98, "Map literals must be pre fixed with 'const' when used as a constant expression"); |
| 1206 | 1206 |
| 1207 /** | 1207 /** |
| 1208 * Enum proposal: It is a static warning if all of the following conditions ho ld: | 1208 * Enum proposal: It is a static warning if all of the following conditions ho ld: |
| 1209 * * The switch statement does not have a 'default' clause. | 1209 * * The switch statement does not have a 'default' clause. |
| 1210 * * The static type of <i>e</i> is an enumerated typed with elements <i>id<su b>1</sub></i>, | 1210 * * The static type of <i>e</i> is an enumerated typed with elements <i>id<su b>1</sub></i>, |
| 1211 * …, <i>id<sub>n</sub></i>. | 1211 * …, <i>id<sub>n</sub></i>. |
| 1212 * * The sets {<i>e<sub>1</sub></i>, …, <i>e<sub>k</sub></i>} and {<i>i d<sub>1</sub></i>, | 1212 * * The sets {<i>e<sub>1</sub></i>, …, <i>e<sub>k</sub></i>} and {<i>i d<sub>1</sub></i>, |
| 1213 * …, <i>id<sub>n</sub></i>} are not the same. | 1213 * …, <i>id<sub>n</sub></i>} are not the same. |
| 1214 * | 1214 * |
| 1215 * @param constantName the name of the constant that is missing | 1215 * @param constantName the name of the constant that is missing |
| 1216 */ | 1216 */ |
| 1217 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const Comp ileTimeErrorCode.con2('MISSING_ENUM_CONSTANT_IN_SWITCH', 99, "Missing case claus e for '%s'", "Add a case clause for the missing constant or add a default clause ."); | 1217 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const Comp ileTimeErrorCode.con2("MISSING_ENUM_CONSTANT_IN_SWITCH", 99, "Missing case claus e for '{0}'", "Add a case clause for the missing constant or add a default claus e."); |
| 1218 | 1218 |
| 1219 /** | 1219 /** |
| 1220 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a | 1220 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a |
| 1221 * constructor. | 1221 * constructor. |
| 1222 * | 1222 * |
| 1223 * @param typeName the name of the mixin that is invalid | 1223 * @param typeName the name of the mixin that is invalid |
| 1224 */ | 1224 */ |
| 1225 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 100, "The class '%s' cannot be us ed as a mixin because it declares a constructor"); | 1225 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1("MIXIN_DECLARES_CONSTRUCTOR", 100, "The class '{0}' cannot be u sed as a mixin because it declares a constructor"); |
| 1226 | 1226 |
| 1227 /** | 1227 /** |
| 1228 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application | 1228 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application |
| 1229 * <i>C</i> includes a deferred type expression. | 1229 * <i>C</i> includes a deferred type expression. |
| 1230 * | 1230 * |
| 1231 * @param typeName the name of the type that cannot be extended | 1231 * @param typeName the name of the type that cannot be extended |
| 1232 * @see #EXTENDS_DEFERRED_CLASS | 1232 * @see #EXTENDS_DEFERRED_CLASS |
| 1233 * @see #IMPLEMENTS_DEFERRED_CLASS | 1233 * @see #IMPLEMENTS_DEFERRED_CLASS |
| 1234 */ | 1234 */ |
| 1235 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1('MIXIN_DEFERRED_CLASS', 101, "This class cannot mixin the deferred cl ass '%s'"); | 1235 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1("MIXIN_DEFERRED_CLASS", 101, "This class cannot mixin the deferred cl ass '{0}'"); |
| 1236 | 1236 |
| 1237 /** | 1237 /** |
| 1238 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not | 1238 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not |
| 1239 * Object. | 1239 * Object. |
| 1240 * | 1240 * |
| 1241 * @param typeName the name of the mixin that is invalid | 1241 * @param typeName the name of the mixin that is invalid |
| 1242 */ | 1242 */ |
| 1243 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 102, "The class '%s' cann ot be used as a mixin because it extends a class other than Object"); | 1243 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1("MIXIN_INHERITS_FROM_NOT_OBJECT", 102, "The class '{0}' can not be used as a mixin because it extends a class other than Object"); |
| 1244 | 1244 |
| 1245 /** | 1245 /** |
| 1246 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. | 1246 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. |
| 1247 * | 1247 * |
| 1248 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. | 1248 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. |
| 1249 * | 1249 * |
| 1250 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. | 1250 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. |
| 1251 * | 1251 * |
| 1252 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to | 1252 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to |
| 1253 * attempt to extend or implement num. | 1253 * attempt to extend or implement num. |
| 1254 * | 1254 * |
| 1255 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. | 1255 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. |
| 1256 * | 1256 * |
| 1257 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. | 1257 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. |
| 1258 * | 1258 * |
| 1259 * @param typeName the name of the type that cannot be extended | 1259 * @param typeName the name of the type that cannot be extended |
| 1260 * @see #IMPLEMENTS_DISALLOWED_CLASS | 1260 * @see #IMPLEMENTS_DISALLOWED_CLASS |
| 1261 */ | 1261 */ |
| 1262 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 103, "Classes cannot mixin '%s'"); | 1262 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1("MIXIN_OF_DISALLOWED_CLASS", 103, "Classes cannot mixin '{0}'"); |
| 1263 | 1263 |
| 1264 /** | 1264 /** |
| 1265 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. | 1265 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. |
| 1266 */ | 1266 */ |
| 1267 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode.c on1('MIXIN_OF_ENUM', 104, "Classes cannot mixin an enum"); | 1267 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode.c on1("MIXIN_OF_ENUM", 104, "Classes cannot mixin an enum"); |
| 1268 | 1268 |
| 1269 /** | 1269 /** |
| 1270 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin | 1270 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin |
| 1271 * available in the immediately enclosing scope. | 1271 * available in the immediately enclosing scope. |
| 1272 */ | 1272 */ |
| 1273 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 105, "Classes can only mixin other classes"); | 1273 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1("MIXIN_OF_NON_CLASS", 105, "Classes can only mixin other classes"); |
| 1274 | 1274 |
| 1275 /** | 1275 /** |
| 1276 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super. | 1276 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super. |
| 1277 */ | 1277 */ |
| 1278 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1('MIXIN_REFERENCES_SUPER', 106, "The class '%s' cannot be used as a mixin because it references 'super'"); | 1278 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1("MIXIN_REFERENCES_SUPER", 106, "The class '{0}' cannot be used as a mixin because it references 'super'"); |
| 1279 | 1279 |
| 1280 /** | 1280 /** |
| 1281 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available | 1281 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available |
| 1282 * in the immediately enclosing scope. | 1282 * in the immediately enclosing scope. |
| 1283 */ | 1283 */ |
| 1284 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 107, "Mixin can only be applied to class"); | 1284 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1("MIXIN_WITH_NON_CLASS_SUPERCLASS", 107, "Mixin can only be applied to class"); |
| 1285 | 1285 |
| 1286 /** | 1286 /** |
| 1287 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its | 1287 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its |
| 1288 * only action is to invoke another generative constructor. | 1288 * only action is to invoke another generative constructor. |
| 1289 */ | 1289 */ |
| 1290 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 108, "Constructor may have at most one 'this' redirection"); | 1290 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1("MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ", 108, "Constructor may have at most one 'this' redirection"); |
| 1291 | 1291 |
| 1292 /** | 1292 /** |
| 1293 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may | 1293 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may |
| 1294 * include at most one superinitializer in its initializer list or a compile t ime error occurs. | 1294 * include at most one superinitializer in its initializer list or a compile t ime error occurs. |
| 1295 */ | 1295 */ |
| 1296 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 109, "Constructor may have at m ost one 'super' initializer"); | 1296 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1("MULTIPLE_SUPER_INITIALIZERS", 109, "Constructor may have at m ost one 'super' initializer"); |
| 1297 | 1297 |
| 1298 /** | 1298 /** |
| 1299 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the | 1299 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the |
| 1300 * character @, followed by a constant expression that must be either a refere nce to a | 1300 * character @, followed by a constant expression that must be either a refere nce to a |
| 1301 * compile-time constant variable, or a call to a constant constructor. | 1301 * compile-time constant variable, or a call to a constant constructor. |
| 1302 */ | 1302 */ |
| 1303 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 110, "Annotatio n creation must have arguments"); | 1303 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1("NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS", 110, "Annotatio n creation must have arguments"); |
| 1304 | 1304 |
| 1305 /** | 1305 /** |
| 1306 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer | 1306 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer |
| 1307 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the | 1307 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the |
| 1308 * enclosing class is class <i>Object</i>. | 1308 * enclosing class is class <i>Object</i>. |
| 1309 * | 1309 * |
| 1310 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a | 1310 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a |
| 1311 * generative constructor named <i>S</i> (respectively <i>S.id</i>) | 1311 * generative constructor named <i>S</i> (respectively <i>S.id</i>) |
| 1312 */ | 1312 */ |
| 1313 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 111, "The c lass '%s' does not have a default constructor"); | 1313 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1("NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT", 111, "The c lass '{0}' does not have a default constructor"); |
| 1314 | 1314 |
| 1315 /** | 1315 /** |
| 1316 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a | 1316 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a |
| 1317 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>. | 1317 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>. |
| 1318 * | 1318 * |
| 1319 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a | 1319 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a |
| 1320 * generative constructor named <i>S</i> (respectively <i>S.id</i>) | 1320 * generative constructor named <i>S</i> (respectively <i>S.id</i>) |
| 1321 */ | 1321 */ |
| 1322 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 112, "The c lass '%s' does not have a default constructor"); | 1322 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1("NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT", 112, "The c lass '{0}' does not have a default constructor"); |
| 1323 | 1323 |
| 1324 /** | 1324 /** |
| 1325 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has | 1325 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has |
| 1326 * no explicit type arguments appears in a place where a statement is expected . | 1326 * no explicit type arguments appears in a place where a statement is expected . |
| 1327 */ | 1327 */ |
| 1328 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 113, "A non -constant map literal without type arguments cannot be used as an expression sta tement"); | 1328 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1("NON_CONST_MAP_AS_EXPRESSION_STATEMENT", 113, "A non -constant map literal without type arguments cannot be used as an expression sta tement"); |
| 1329 | 1329 |
| 1330 /** | 1330 /** |
| 1331 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> … | 1331 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> … |
| 1332 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1 </sub> … | 1332 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1 </sub> … |
| 1333 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form | 1333 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form |
| 1334 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub> 1</sub>: | 1334 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub> 1</sub>: |
| 1335 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case e<sub>n</sub>: | 1335 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case e<sub>n</sub>: |
| 1336 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not | 1336 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not |
| 1337 * compile-time constants, for all <i>1 <= k <= n</i>. | 1337 * compile-time constants, for all <i>1 <= k <= n</i>. |
| 1338 */ | 1338 */ |
| 1339 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 114, "Case expressions must b e constant"); | 1339 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1("NON_CONSTANT_CASE_EXPRESSION", 114, "Case expressions must b e constant"); |
| 1340 | 1340 |
| 1341 /** | 1341 /** |
| 1342 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> … | 1342 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> … |
| 1343 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1 </sub> … | 1343 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1 </sub> … |
| 1344 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form | 1344 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form |
| 1345 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub> 1</sub>: | 1345 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub> 1</sub>: |
| 1346 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case e<sub>n</sub>: | 1346 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case e<sub>n</sub>: |
| 1347 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not | 1347 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not |
| 1348 * compile-time constants, for all <i>1 <= k <= n</i>. | 1348 * compile-time constants, for all <i>1 <= k <= n</i>. |
| 1349 * | 1349 * |
| 1350 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1350 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1351 * deferred prefix. | 1351 * deferred prefix. |
| 1352 */ | 1352 */ |
| 1353 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFE RRED_LIBRARY', 115, "Constant values from a deferred library cannot be used as a case expression"); | 1353 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode.con1("NON_CONSTANT_CASE_EXPRESSION_FROM_DEFE RRED_LIBRARY", 115, "Constant values from a deferred library cannot be used as a case expression"); |
| 1354 | 1354 |
| 1355 /** | 1355 /** |
| 1356 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional | 1356 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional |
| 1357 * parameter is not a compile-time constant. | 1357 * parameter is not a compile-time constant. |
| 1358 */ | 1358 */ |
| 1359 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 116, "Default values of an option al parameter must be constant"); | 1359 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1("NON_CONSTANT_DEFAULT_VALUE", 116, "Default values of an option al parameter must be constant"); |
| 1360 | 1360 |
| 1361 /** | 1361 /** |
| 1362 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional | 1362 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional |
| 1363 * parameter is not a compile-time constant. | 1363 * parameter is not a compile-time constant. |
| 1364 * | 1364 * |
| 1365 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1365 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1366 * deferred prefix. | 1366 * deferred prefix. |
| 1367 */ | 1367 */ |
| 1368 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED _LIBRARY', 117, "Constant values from a deferred library cannot be used as a def ault parameter value"); | 1368 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode.con1("NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED _LIBRARY", 117, "Constant values from a deferred library cannot be used as a def ault parameter value"); |
| 1369 | 1369 |
| 1370 /** | 1370 /** |
| 1371 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a | 1371 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a |
| 1372 * compile-time constant. | 1372 * compile-time constant. |
| 1373 */ | 1373 */ |
| 1374 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 118, "'const' lists must have all c onstant values"); | 1374 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1("NON_CONSTANT_LIST_ELEMENT", 118, "'const' lists must have all c onstant values"); |
| 1375 | 1375 |
| 1376 /** | 1376 /** |
| 1377 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a | 1377 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a |
| 1378 * compile-time constant. | 1378 * compile-time constant. |
| 1379 * | 1379 * |
| 1380 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1380 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1381 * deferred prefix. | 1381 * deferred prefix. |
| 1382 */ | 1382 */ |
| 1383 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_L IBRARY', 119, "Constant values from a deferred library cannot be used as values in a 'const' list"); | 1383 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode.con1("NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_L IBRARY", 119, "Constant values from a deferred library cannot be used as values in a 'const' list"); |
| 1384 | 1384 |
| 1385 /** | 1385 /** |
| 1386 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map | 1386 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map |
| 1387 * literal is not a compile-time constant. | 1387 * literal is not a compile-time constant. |
| 1388 */ | 1388 */ |
| 1389 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 120, "The keys in a map must be constant"); | 1389 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1("NON_CONSTANT_MAP_KEY", 120, "The keys in a map must be constant"); |
| 1390 | 1390 |
| 1391 /** | 1391 /** |
| 1392 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map | 1392 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map |
| 1393 * literal is not a compile-time constant. | 1393 * literal is not a compile-time constant. |
| 1394 * | 1394 * |
| 1395 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1395 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1396 * deferred prefix. | 1396 * deferred prefix. |
| 1397 */ | 1397 */ |
| 1398 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', 1 21, "Constant values from a deferred library cannot be used as keys in a map"); | 1398 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1("NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY", 1 21, "Constant values from a deferred library cannot be used as keys in a map"); |
| 1399 | 1399 |
| 1400 /** | 1400 /** |
| 1401 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map | 1401 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map |
| 1402 * literal is not a compile-time constant. | 1402 * literal is not a compile-time constant. |
| 1403 */ | 1403 */ |
| 1404 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1('NON_CONSTANT_MAP_VALUE', 122, "The values in a 'const' map must be constant"); | 1404 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1("NON_CONSTANT_MAP_VALUE", 122, "The values in a 'const' map must be constant"); |
| 1405 | 1405 |
| 1406 /** | 1406 /** |
| 1407 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map | 1407 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map |
| 1408 * literal is not a compile-time constant. | 1408 * literal is not a compile-time constant. |
| 1409 * | 1409 * |
| 1410 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1410 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1411 * deferred prefix. | 1411 * deferred prefix. |
| 1412 */ | 1412 */ |
| 1413 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY ', 123, "Constant values from a deferred library cannot be used as values in a ' const' map"); | 1413 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1("NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY ", 123, "Constant values from a deferred library cannot be used as values in a ' const' map"); |
| 1414 | 1414 |
| 1415 /** | 1415 /** |
| 1416 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the | 1416 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the |
| 1417 * character @, followed by a constant expression that must be either a refere nce to a | 1417 * character @, followed by a constant expression that must be either a refere nce to a |
| 1418 * compile-time constant variable, or a call to a constant constructor. | 1418 * compile-time constant variable, or a call to a constant constructor. |
| 1419 * | 1419 * |
| 1420 * "From deferred library" case is covered by | 1420 * "From deferred library" case is covered by |
| 1421 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. | 1421 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. |
| 1422 */ | 1422 */ |
| 1423 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 124, "Annotatio n creation can use only 'const' constructor"); | 1423 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1("NON_CONSTANT_ANNOTATION_CONSTRUCTOR", 124, "Annotatio n creation can use only 'const' constructor"); |
| 1424 | 1424 |
| 1425 /** | 1425 /** |
| 1426 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a | 1426 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a |
| 1427 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. | 1427 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. |
| 1428 */ | 1428 */ |
| 1429 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 125, "Initializer e xpressions in constant constructors must be constants"); | 1429 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1("NON_CONSTANT_VALUE_IN_INITIALIZER", 125, "Initializer e xpressions in constant constructors must be constants"); |
| 1430 | 1430 |
| 1431 /** | 1431 /** |
| 1432 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a | 1432 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a |
| 1433 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. | 1433 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. |
| 1434 * | 1434 * |
| 1435 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a | 1435 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a |
| 1436 * deferred prefix. | 1436 * deferred prefix. |
| 1437 */ | 1437 */ |
| 1438 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER _FROM_DEFERRED_LIBRARY', 126, "Constant values from a deferred library cannot be used as constant initializers"); | 1438 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode.con1("NON_CONSTANT_VALUE_IN_INITIALIZER _FROM_DEFERRED_LIBRARY", 126, "Constant values from a deferred library cannot be used as constant initializers"); |
| 1439 | 1439 |
| 1440 /** | 1440 /** |
| 1441 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>. | 1441 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>. |
| 1442 * | 1442 * |
| 1443 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 1443 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 1444 * uncaught exception being thrown. | 1444 * uncaught exception being thrown. |
| 1445 * | 1445 * |
| 1446 * @param requiredCount the expected number of required arguments | 1446 * @param requiredCount the expected number of required arguments |
| 1447 * @param argumentCount the actual number of positional arguments given | 1447 * @param argumentCount the actual number of positional arguments given |
| 1448 */ | 1448 */ |
| 1449 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 127, "%d required argument( s) expected, but %d found"); | 1449 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1("NOT_ENOUGH_REQUIRED_ARGUMENTS", 127, "{0} required argument (s) expected, but {1} found"); |
| 1450 | 1450 |
| 1451 /** | 1451 /** |
| 1452 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears | 1452 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears |
| 1453 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is | 1453 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is |
| 1454 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> | 1454 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> |
| 1455 * (respectively <i>S.id</i>) | 1455 * (respectively <i>S.id</i>) |
| 1456 */ | 1456 */ |
| 1457 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 128, "The generative constructor '%s' expected, but factory found"); | 1457 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1("NON_GENERATIVE_CONSTRUCTOR", 128, "The generative constructor '{0}' expected, but factory found"); |
| 1458 | 1458 |
| 1459 /** | 1459 /** |
| 1460 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object. | 1460 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object. |
| 1461 */ | 1461 */ |
| 1462 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 129, ""); | 1462 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1("OBJECT_CANNOT_EXTEND_ANOTHER_CLASS", 129, ""); |
| 1463 | 1463 |
| 1464 /** | 1464 /** |
| 1465 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator. | 1465 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator. |
| 1466 */ | 1466 */ |
| 1467 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 130, "Optional parameters are not allowed when defining an operator"); | 1467 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1("OPTIONAL_PARAMETER_IN_OPERATOR", 130, "Optional parameters are not allowed when defining an operator"); |
| 1468 | 1468 |
| 1469 /** | 1469 /** |
| 1470 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part | 1470 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part |
| 1471 * declaration. | 1471 * declaration. |
| 1472 * | 1472 * |
| 1473 * @param uri the uri pointing to a non-library declaration | 1473 * @param uri the uri pointing to a non-library declaration |
| 1474 */ | 1474 */ |
| 1475 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1('PART_OF_NON_PART', 131, "The included part '%s' must have a part-of dire ctive"); | 1475 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1("PART_OF_NON_PART", 131, "The included part '{0}' must have a part-of dir ective"); |
| 1476 | 1476 |
| 1477 /** | 1477 /** |
| 1478 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member | 1478 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member |
| 1479 * named <i>p</i>. | 1479 * named <i>p</i>. |
| 1480 */ | 1480 */ |
| 1481 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 132, "The n ame '%s' is already used as an import prefix and cannot be used to name a top-le vel element"); | 1481 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1("PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER", 132, "The n ame '{0}' is already used as an import prefix and cannot be used to name a top-l evel element"); |
| 1482 | 1482 |
| 1483 /** | 1483 /** |
| 1484 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter | 1484 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter |
| 1485 * begins with an '_' character. | 1485 * begins with an '_' character. |
| 1486 */ | 1486 */ |
| 1487 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 133, "Named optional parameters c annot start with an underscore"); | 1487 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1("PRIVATE_OPTIONAL_PARAMETER", 133, "Named optional parameters c annot start with an underscore"); |
| 1488 | 1488 |
| 1489 /** | 1489 /** |
| 1490 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression | 1490 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression |
| 1491 * depends on itself. | 1491 * depends on itself. |
| 1492 */ | 1492 */ |
| 1493 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 134, ""); | 1493 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1("RECURSIVE_COMPILE_TIME_CONSTANT", 134, ""); |
| 1494 | 1494 |
| 1495 /** | 1495 /** |
| 1496 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its | 1496 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its |
| 1497 * only action is to invoke another generative constructor. | 1497 * only action is to invoke another generative constructor. |
| 1498 * | 1498 * |
| 1499 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in | 1499 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in |
| 1500 * specification. But it was added to the co19 and there is same error for fac tories. | 1500 * specification. But it was added to the co19 and there is same error for fac tories. |
| 1501 * | 1501 * |
| 1502 * https://code.google.com/p/dart/issues/detail?id=954 | 1502 * https://code.google.com/p/dart/issues/detail?id=954 |
| 1503 */ | 1503 */ |
| 1504 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 135, "Cycle in redirectin g generative constructors"); | 1504 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1("RECURSIVE_CONSTRUCTOR_REDIRECT", 135, "Cycle in redirectin g generative constructors"); |
| 1505 | 1505 |
| 1506 /** | 1506 /** |
| 1507 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to | 1507 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to |
| 1508 * itself, either directly or indirectly via a sequence of redirections. | 1508 * itself, either directly or indirectly via a sequence of redirections. |
| 1509 */ | 1509 */ |
| 1510 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 136, "Cycle in redirecting factor y constructors"); | 1510 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1("RECURSIVE_FACTORY_REDIRECT", 136, "Cycle in redirecting factor y constructors"); |
| 1511 | 1511 |
| 1512 /** | 1512 /** |
| 1513 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a | 1513 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a |
| 1514 * superinterface of itself. | 1514 * superinterface of itself. |
| 1515 * | 1515 * |
| 1516 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. | 1516 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. |
| 1517 * | 1517 * |
| 1518 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. | 1518 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. |
| 1519 * | 1519 * |
| 1520 * @param className the name of the class that implements itself recursively | 1520 * @param className the name of the class that implements itself recursively |
| 1521 * @param strImplementsPath a string representation of the implements loop | 1521 * @param strImplementsPath a string representation of the implements loop |
| 1522 */ | 1522 */ |
| 1523 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 137, "'%s' cannot be a superinterface of itself: %s"); | 1523 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1("RECURSIVE_INTERFACE_INHERITANCE", 137, "'{0}' cannot be a superinterface of itself: {1}"); |
| 1524 | 1524 |
| 1525 /** | 1525 /** |
| 1526 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a | 1526 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a |
| 1527 * superinterface of itself. | 1527 * superinterface of itself. |
| 1528 * | 1528 * |
| 1529 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. | 1529 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. |
| 1530 * | 1530 * |
| 1531 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. | 1531 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. |
| 1532 * | 1532 * |
| 1533 * @param className the name of the class that implements itself recursively | 1533 * @param className the name of the class that implements itself recursively |
| 1534 */ | 1534 */ |
| 1535 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS', 138, "'%s' cannot extend itself"); | 1535 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1("RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS", 138, "'{0}' cannot extend itself"); |
| 1536 | 1536 |
| 1537 /** | 1537 /** |
| 1538 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a | 1538 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a |
| 1539 * superinterface of itself. | 1539 * superinterface of itself. |
| 1540 * | 1540 * |
| 1541 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. | 1541 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. |
| 1542 * | 1542 * |
| 1543 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. | 1543 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. |
| 1544 * | 1544 * |
| 1545 * @param className the name of the class that implements itself recursively | 1545 * @param className the name of the class that implements itself recursively |
| 1546 */ | 1546 */ |
| 1547 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 139, "'%s' cannot implement itself"); | 1547 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1("RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS", 139, "'{0}' cannot implement itself"); |
| 1548 | 1548 |
| 1549 /** | 1549 /** |
| 1550 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a | 1550 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a |
| 1551 * superinterface of itself. | 1551 * superinterface of itself. |
| 1552 * | 1552 * |
| 1553 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. | 1553 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. |
| 1554 * | 1554 * |
| 1555 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. | 1555 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. |
| 1556 * | 1556 * |
| 1557 * @param className the name of the class that implements itself recursively | 1557 * @param className the name of the class that implements itself recursively |
| 1558 */ | 1558 */ |
| 1559 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_ WITH', 140, "'%s' cannot use itself as a mixin"); | 1559 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode.con1("RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_ WITH", 140, "'{0}' cannot use itself as a mixin"); |
| 1560 | 1560 |
| 1561 /** | 1561 /** |
| 1562 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but | 1562 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but |
| 1563 * <i>k'</i> is not a constant constructor. | 1563 * <i>k'</i> is not a constant constructor. |
| 1564 */ | 1564 */ |
| 1565 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 141, "The constructor ' %s' could not be found in '%s'"); | 1565 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1("REDIRECT_TO_MISSING_CONSTRUCTOR", 141, "The constructor ' {0}' could not be found in '{1}'"); |
| 1566 | 1566 |
| 1567 /** | 1567 /** |
| 1568 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but | 1568 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but |
| 1569 * <i>k'</i> is not a constant constructor. | 1569 * <i>k'</i> is not a constant constructor. |
| 1570 */ | 1570 */ |
| 1571 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1('REDIRECT_TO_NON_CLASS', 142, "The name '%s' is not a type and canno t be used in a redirected constructor"); | 1571 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1("REDIRECT_TO_NON_CLASS", 142, "The name '{0}' is not a type and cann ot be used in a redirected constructor"); |
| 1572 | 1572 |
| 1573 /** | 1573 /** |
| 1574 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but | 1574 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but |
| 1575 * <i>k'</i> is not a constant constructor. | 1575 * <i>k'</i> is not a constant constructor. |
| 1576 */ | 1576 */ |
| 1577 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 143, "Constant fact ory constructor cannot delegate to a non-constant constructor"); | 1577 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1("REDIRECT_TO_NON_CONST_CONSTRUCTOR", 143, "Constant fact ory constructor cannot delegate to a non-constant constructor"); |
| 1578 | 1578 |
| 1579 /** | 1579 /** |
| 1580 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which | 1580 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which |
| 1581 * case its only action is to invoke another generative constructor. | 1581 * case its only action is to invoke another generative constructor. |
| 1582 */ | 1582 */ |
| 1583 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', 1 44, "The constructor '%s' could not be found in '%s'"); | 1583 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1("REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR", 1 44, "The constructor '{0}' could not be found in '{1}'"); |
| 1584 | 1584 |
| 1585 /** | 1585 /** |
| 1586 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which | 1586 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which |
| 1587 * case its only action is to invoke another generative constructor. | 1587 * case its only action is to invoke another generative constructor. |
| 1588 */ | 1588 */ |
| 1589 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_C ONSTRUCTOR', 145, "Generative constructor cannot redirect to a factory construct or"); | 1589 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode.con1("REDIRECT_GENERATIVE_TO_NON_GENERATIVE_C ONSTRUCTOR", 145, "Generative constructor cannot redirect to a factory construct or"); |
| 1590 | 1590 |
| 1591 /** | 1591 /** |
| 1592 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after | 1592 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after |
| 1593 * its initializer, if any, is complete, or a compile-time error occurs. | 1593 * its initializer, if any, is complete, or a compile-time error occurs. |
| 1594 */ | 1594 */ |
| 1595 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 146, "Local variables canno t be referenced before they are declared"); | 1595 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1("REFERENCED_BEFORE_DECLARATION", 146, "Local variables canno t be referenced before they are declared"); |
| 1596 | 1596 |
| 1597 /** | 1597 /** |
| 1598 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not | 1598 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not |
| 1599 * enclosed within a on-catch clause. | 1599 * enclosed within a on-catch clause. |
| 1600 */ | 1600 */ |
| 1601 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 147, "rethrow must be inside of a catch cla use"); | 1601 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1("RETHROW_OUTSIDE_CATCH", 147, "rethrow must be inside of a catch cla use"); |
| 1602 | 1602 |
| 1603 /** | 1603 /** |
| 1604 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> | 1604 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> |
| 1605 * appears in a generative constructor. | 1605 * appears in a generative constructor. |
| 1606 */ | 1606 */ |
| 1607 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 148, "Constructors ca nnot return a value"); | 1607 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1("RETURN_IN_GENERATIVE_CONSTRUCTOR", 148, "Constructors ca nnot return a value"); |
| 1608 | 1608 |
| 1609 /** | 1609 /** |
| 1610 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in | 1610 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in |
| 1611 * another import clause. | 1611 * another import clause. |
| 1612 */ | 1612 */ |
| 1613 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode.con1('SHARED_DEFERRED_PREFIX', 149, "The prefix of a deferred import can not be used in other import directives"); | 1613 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode.con1("SHARED_DEFERRED_PREFIX", 149, "The prefix of a deferred import can not be used in other import directives"); |
| 1614 | 1614 |
| 1615 /** | 1615 /** |
| 1616 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 1616 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
| 1617 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, … | 1617 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, … |
| 1618 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation | 1618 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation |
| 1619 * occurs in a top-level function or variable initializer, in an instance vari able initializer or | 1619 * occurs in a top-level function or variable initializer, in an instance vari able initializer or |
| 1620 * initializer list, in class Object, in a factory constructor, or in a static method or variable | 1620 * initializer list, in class Object, in a factory constructor, or in a static method or variable |
| 1621 * initializer. | 1621 * initializer. |
| 1622 */ | 1622 */ |
| 1623 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 150, "Invalid context for 'super' inv ocation"); | 1623 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1("SUPER_IN_INVALID_CONTEXT", 150, "Invalid context for 'super' inv ocation"); |
| 1624 | 1624 |
| 1625 /** | 1625 /** |
| 1626 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its | 1626 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its |
| 1627 * only action is to invoke another generative constructor. | 1627 * only action is to invoke another generative constructor. |
| 1628 */ | 1628 */ |
| 1629 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 151, "The redirecting constructor cannot have a 'super' initializer"); | 1629 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1("SUPER_IN_REDIRECTING_CONSTRUCTOR", 151, "The redirecting constructor cannot have a 'super' initializer"); |
| 1630 | 1630 |
| 1631 /** | 1631 /** |
| 1632 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time | 1632 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time |
| 1633 * error if a generative constructor of class Object includes a superinitializ er. | 1633 * error if a generative constructor of class Object includes a superinitializ er. |
| 1634 */ | 1634 */ |
| 1635 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 152, ""); | 1635 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1("SUPER_INITIALIZER_IN_OBJECT", 152, ""); |
| 1636 | 1636 |
| 1637 /** | 1637 /** |
| 1638 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a | 1638 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a |
| 1639 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object | 1639 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object |
| 1640 * expression are not subtypes of the bounds of the corresponding formal type parameters of | 1640 * expression are not subtypes of the bounds of the corresponding formal type parameters of |
| 1641 * <i>G</i>. | 1641 * <i>G</i>. |
| 1642 * | 1642 * |
| 1643 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a | 1643 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a |
| 1644 * dynamic error occurs. | 1644 * dynamic error occurs. |
| 1645 * | 1645 * |
| 1646 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise | 1646 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise |
| 1647 * an exception. | 1647 * an exception. |
| 1648 * | 1648 * |
| 1649 * @param boundedTypeName the name of the type used in the instance creation t hat should be | 1649 * @param boundedTypeName the name of the type used in the instance creation t hat should be |
| 1650 * limited by the bound as specified in the class declaration | 1650 * limited by the bound as specified in the class declaration |
| 1651 * @param boundingTypeName the name of the bounding type | 1651 * @param boundingTypeName the name of the bounding type |
| 1652 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS | 1652 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS |
| 1653 */ | 1653 */ |
| 1654 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 153, "'%s' does not extend '%s'"); | 1654 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1("TYPE_ARGUMENT_NOT_MATCHING_BOUNDS", 153, "'{0}' does no t extend '{1}'"); |
| 1655 | 1655 |
| 1656 /** | 1656 /** |
| 1657 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a | 1657 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a |
| 1658 * compile time error. | 1658 * compile time error. |
| 1659 */ | 1659 */ |
| 1660 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 154, "Type alias cannot reference itself directly or recursively via another typedef"); | 1660 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1("TYPE_ALIAS_CANNOT_REFERENCE_ITSELF", 154, "Type alias cannot reference itself directly or recursively via another typedef"); |
| 1661 | 1661 |
| 1662 /** | 1662 /** |
| 1663 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current | 1663 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current |
| 1664 * scope, optionally followed by type arguments. | 1664 * scope, optionally followed by type arguments. |
| 1665 */ | 1665 */ |
| 1666 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 155, "Undefined class '%s'"); | 1666 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1("UNDEFINED_CLASS", 155, "Undefined class '{0}'"); |
| 1667 | 1667 |
| 1668 /** | 1668 /** |
| 1669 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears | 1669 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears |
| 1670 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is | 1670 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is |
| 1671 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> | 1671 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> |
| 1672 * (respectively <i>S.id</i>) | 1672 * (respectively <i>S.id</i>) |
| 1673 */ | 1673 */ |
| 1674 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 156, "The cla ss '%s' does not have a generative constructor '%s'"); | 1674 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1("UNDEFINED_CONSTRUCTOR_IN_INITIALIZER", 156, "The cla ss '{0}' does not have a generative constructor '{1}'"); |
| 1675 | 1675 |
| 1676 /** | 1676 /** |
| 1677 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears | 1677 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears |
| 1678 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is | 1678 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is |
| 1679 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> | 1679 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> |
| 1680 * (respectively <i>S.id</i>) | 1680 * (respectively <i>S.id</i>) |
| 1681 */ | 1681 */ |
| 1682 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ', 157, "The class '%s' does not have a default generative constructor"); | 1682 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1("UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ", 157, "The class '{0}' does not have a default generative constructor"); |
| 1683 | 1683 |
| 1684 /** | 1684 /** |
| 1685 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, | 1685 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, |
| 1686 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... | 1686 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... |
| 1687 * <i>p<sub>n+k</sub></i>} or a static warning occurs. | 1687 * <i>p<sub>n+k</sub></i>} or a static warning occurs. |
| 1688 * | 1688 * |
| 1689 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an | 1689 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an |
| 1690 * uncaught exception being thrown. | 1690 * uncaught exception being thrown. |
| 1691 * | 1691 * |
| 1692 * @param name the name of the requested named parameter | 1692 * @param name the name of the requested named parameter |
| 1693 */ | 1693 */ |
| 1694 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 158, "The named parameter '%s' is n ot defined"); | 1694 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1("UNDEFINED_NAMED_PARAMETER", 158, "The named parameter '{0}' is not defined"); |
| 1695 | 1695 |
| 1696 /** | 1696 /** |
| 1697 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is | 1697 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is |
| 1698 * not a library declaration. | 1698 * not a library declaration. |
| 1699 * | 1699 * |
| 1700 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is | 1700 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is |
| 1701 * not a library declaration. | 1701 * not a library declaration. |
| 1702 * | 1702 * |
| 1703 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part | 1703 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part |
| 1704 * declaration. | 1704 * declaration. |
| 1705 * | 1705 * |
| 1706 * @param uri the URI pointing to a non-existent file | 1706 * @param uri the URI pointing to a non-existent file |
| 1707 * @see #INVALID_URI | 1707 * @see #INVALID_URI |
| 1708 */ | 1708 */ |
| 1709 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 159, "Target of URI does not exist: '%s'"); | 1709 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1("URI_DOES_NOT_EXIST", 159, "Target of URI does not exist: '{0}'"); |
| 1710 | 1710 |
| 1711 /** | 1711 /** |
| 1712 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if | 1712 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if |
| 1713 * <i>x</i> involves string interpolation. | 1713 * <i>x</i> involves string interpolation. |
| 1714 * | 1714 * |
| 1715 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if | 1715 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if |
| 1716 * <i>s</i> involves string interpolation. | 1716 * <i>s</i> involves string interpolation. |
| 1717 * | 1717 * |
| 1718 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is | 1718 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is |
| 1719 * not a compile-time constant, or if <i>x</i> involves string interpolation. | 1719 * not a compile-time constant, or if <i>x</i> involves string interpolation. |
| 1720 */ | 1720 */ |
| 1721 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 160, "URIs cannot use string interpolatio n"); | 1721 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1("URI_WITH_INTERPOLATION", 160, "URIs cannot use string interpolatio n"); |
| 1722 | 1722 |
| 1723 /** | 1723 /** |
| 1724 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is | 1724 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is |
| 1725 * not 2. It is a compile time error if the arity of a user-declared operator with one of the | 1725 * not 2. It is a compile time error if the arity of a user-declared operator with one of the |
| 1726 * names: <, >, <=, >=, ==, +, /, ~/, *, %, |, ^, &, <<, > ;>, [] is not 1. | 1726 * names: <, >, <=, >=, ==, +, /, ~/, *, %, |, ^, &, <<, > ;>, [] is not 1. |
| 1727 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a | 1727 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a |
| 1728 * compile time error if the arity of the user-declared operator ~ is not 0. | 1728 * compile time error if the arity of the user-declared operator ~ is not 0. |
| 1729 * | 1729 * |
| 1730 * @param operatorName the name of the declared operator | 1730 * @param operatorName the name of the declared operator |
| 1731 * @param expectedNumberOfParameters the number of parameters expected | 1731 * @param expectedNumberOfParameters the number of parameters expected |
| 1732 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration | 1732 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration |
| 1733 */ | 1733 */ |
| 1734 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 161, "O perator '%s' should declare exactly %d parameter(s), but %d found"); | 1734 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1("WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR", 161, "O perator '{0}' should declare exactly {1} parameter(s), but {2} found"); |
| 1735 | 1735 |
| 1736 /** | 1736 /** |
| 1737 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not | 1737 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not |
| 1738 * 0 or 1. | 1738 * 0 or 1. |
| 1739 * | 1739 * |
| 1740 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration | 1740 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration |
| 1741 */ | 1741 */ |
| 1742 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US', 162, "Operator '-' should declare 0 or 1 parameter, but %d found"); | 1742 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1("WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US", 162, "Operator '-' should declare 0 or 1 parameter, but {0} found"); |
| 1743 | 1743 |
| 1744 /** | 1744 /** |
| 1745 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include | 1745 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include |
| 1746 * exactly one required formal parameter <i>p</i>. | 1746 * exactly one required formal parameter <i>p</i>. |
| 1747 */ | 1747 */ |
| 1748 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 163, "Sette rs should declare exactly one required parameter"); | 1748 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1("WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER", 163, "Sette rs should declare exactly one required parameter"); |
| 1749 | 1749 |
| 1750 static const List<CompileTimeErrorCode> values = const [ | 1750 static const List<CompileTimeErrorCode> values = const [ |
| 1751 ACCESS_PRIVATE_ENUM_FIELD, | 1751 ACCESS_PRIVATE_ENUM_FIELD, |
| 1752 AMBIGUOUS_EXPORT, | 1752 AMBIGUOUS_EXPORT, |
| 1753 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, | 1753 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, |
| 1754 BUILT_IN_IDENTIFIER_AS_TYPE, | 1754 BUILT_IN_IDENTIFIER_AS_TYPE, |
| 1755 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, | 1755 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, |
| 1756 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, | 1756 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, |
| 1757 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, | 1757 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, |
| 1758 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, | 1758 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2340 class HintCode extends Enum<HintCode> implements ErrorCode { | 2340 class HintCode extends Enum<HintCode> implements ErrorCode { |
| 2341 /** | 2341 /** |
| 2342 * This hint is generated anywhere where the | 2342 * This hint is generated anywhere where the |
| 2343 * [StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, if we used | 2343 * [StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, if we used |
| 2344 * propagated information for the warnings. | 2344 * propagated information for the warnings. |
| 2345 * | 2345 * |
| 2346 * @param actualType the name of the actual argument type | 2346 * @param actualType the name of the actual argument type |
| 2347 * @param expectedType the name of the expected type | 2347 * @param expectedType the name of the expected type |
| 2348 * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE | 2348 * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE |
| 2349 */ | 2349 */ |
| 2350 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode.con1('ARGU MENT_TYPE_NOT_ASSIGNABLE', 0, "The argument type '%s' cannot be assigned to the parameter type '%s'"); | 2350 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode.con1("ARGU MENT_TYPE_NOT_ASSIGNABLE", 0, "The argument type '{0}' cannot be assigned to the parameter type '{1}'"); |
| 2351 | 2351 |
| 2352 /** | 2352 /** |
| 2353 * Dead code is code that is never reached, this can happen for instance if a statement follows a | 2353 * Dead code is code that is never reached, this can happen for instance if a statement follows a |
| 2354 * return statement. | 2354 * return statement. |
| 2355 */ | 2355 */ |
| 2356 static const HintCode DEAD_CODE = const HintCode.con1('DEAD_CODE', 1, "Dead co de"); | 2356 static const HintCode DEAD_CODE = const HintCode.con1("DEAD_CODE", 1, "Dead co de"); |
| 2357 | 2357 |
| 2358 /** | 2358 /** |
| 2359 * Dead code is code that is never reached. This case covers cases where the u ser has catch | 2359 * Dead code is code that is never reached. This case covers cases where the u ser has catch |
| 2360 * clauses after `catch (e)` or `on Object catch (e)`. | 2360 * clauses after `catch (e)` or `on Object catch (e)`. |
| 2361 */ | 2361 */ |
| 2362 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode.con1('D EAD_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e) ' or an 'on Object catch (e)' are never reached"); | 2362 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode.con1("D EAD_CODE_CATCH_FOLLOWING_CATCH", 2, "Dead code, catch clauses after a 'catch (e) ' or an 'on Object catch (e)' are never reached"); |
| 2363 | 2363 |
| 2364 /** | 2364 /** |
| 2365 * Dead code is code that is never reached. This case covers cases where the u ser has an on-catch | 2365 * Dead code is code that is never reached. This case covers cases where the u ser has an on-catch |
| 2366 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh t. | 2366 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh t. |
| 2367 * | 2367 * |
| 2368 * @param subtypeName name of the subtype | 2368 * @param subtypeName name of the subtype |
| 2369 * @param supertypeName name of the supertype | 2369 * @param supertypeName name of the supertype |
| 2370 */ | 2370 */ |
| 2371 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode.con1('DEAD_C ODE_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed since '%s' is a subtype of '%s'"); | 2371 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode.con1("DEAD_C ODE_ON_CATCH_SUBTYPE", 3, "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'"); |
| 2372 | 2372 |
| 2373 /** | 2373 /** |
| 2374 * Deprecated members should not be invoked or used. | 2374 * Deprecated members should not be invoked or used. |
| 2375 * | 2375 * |
| 2376 * @param memberName the name of the member | 2376 * @param memberName the name of the member |
| 2377 */ | 2377 */ |
| 2378 static const HintCode DEPRECATED_MEMBER_USE = const HintCode.con1('DEPRECATED_ MEMBER_USE', 4, "'%s' is deprecated"); | 2378 static const HintCode DEPRECATED_MEMBER_USE = const HintCode.con1("DEPRECATED_ MEMBER_USE", 4, "'{0}' is deprecated"); |
| 2379 | 2379 |
| 2380 /** | 2380 /** |
| 2381 * Duplicate imports. | 2381 * Duplicate imports. |
| 2382 */ | 2382 */ |
| 2383 static const HintCode DUPLICATE_IMPORT = const HintCode.con1('DUPLICATE_IMPORT ', 5, "Duplicate import"); | 2383 static const HintCode DUPLICATE_IMPORT = const HintCode.con1("DUPLICATE_IMPORT ", 5, "Duplicate import"); |
| 2384 | 2384 |
| 2385 /** | 2385 /** |
| 2386 * Hint to use the ~/ operator. | 2386 * Hint to use the ~/ operator. |
| 2387 */ | 2387 */ |
| 2388 static const HintCode DIVISION_OPTIMIZATION = const HintCode.con1('DIVISION_OP TIMIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()"); | 2388 static const HintCode DIVISION_OPTIMIZATION = const HintCode.con1("DIVISION_OP TIMIZATION", 6, "The operator x ~/ y is more efficient than (x / y).toInt()"); |
| 2389 | 2389 |
| 2390 /** | 2390 /** |
| 2391 * Hint for the `x is double` type checks. | 2391 * Hint for the `x is double` type checks. |
| 2392 */ | 2392 */ |
| 2393 static const HintCode IS_DOUBLE = const HintCode.con1('IS_DOUBLE', 7, "When co mpiled to JS, this test might return true when the left hand side is an int"); | 2393 static const HintCode IS_DOUBLE = const HintCode.con1("IS_DOUBLE", 7, "When co mpiled to JS, this test might return true when the left hand side is an int"); |
| 2394 | 2394 |
| 2395 /** | 2395 /** |
| 2396 * Hint for the `x is int` type checks. | 2396 * Hint for the `x is int` type checks. |
| 2397 */ | 2397 */ |
| 2398 static const HintCode IS_INT = const HintCode.con1('IS_INT', 8, "When compiled to JS, this test might return true when the left hand side is a double"); | 2398 static const HintCode IS_INT = const HintCode.con1("IS_INT", 8, "When compiled to JS, this test might return true when the left hand side is a double"); |
| 2399 | 2399 |
| 2400 /** | 2400 /** |
| 2401 * Hint for the `x is! double` type checks. | 2401 * Hint for the `x is! double` type checks. |
| 2402 */ | 2402 */ |
| 2403 static const HintCode IS_NOT_DOUBLE = const HintCode.con1('IS_NOT_DOUBLE', 9, "When compiled to JS, this test might return false when the left hand side is an int"); | 2403 static const HintCode IS_NOT_DOUBLE = const HintCode.con1("IS_NOT_DOUBLE", 9, "When compiled to JS, this test might return false when the left hand side is an int"); |
| 2404 | 2404 |
| 2405 /** | 2405 /** |
| 2406 * Hint for the `x is! int` type checks. | 2406 * Hint for the `x is! int` type checks. |
| 2407 */ | 2407 */ |
| 2408 static const HintCode IS_NOT_INT = const HintCode.con1('IS_NOT_INT', 10, "When compiled to JS, this test might return false when the left hand side is a doubl e"); | 2408 static const HintCode IS_NOT_INT = const HintCode.con1("IS_NOT_INT", 10, "When compiled to JS, this test might return false when the left hand side is a doubl e"); |
| 2409 | 2409 |
| 2410 /** | 2410 /** |
| 2411 * Deferred libraries shouldn't define a top level function 'loadLibrary'. | 2411 * Deferred libraries shouldn't define a top level function 'loadLibrary'. |
| 2412 */ | 2412 */ |
| 2413 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC ode.con1('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', 11, "The library '%s' def ines a top-level function named 'loadLibrary' which is hidden by deferring this library"); | 2413 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC ode.con1("IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION", 11, "The library '{0}' de fines a top-level function named 'loadLibrary' which is hidden by deferring this library"); |
| 2414 | 2414 |
| 2415 /** | 2415 /** |
| 2416 * This hint is generated anywhere where the [StaticTypeWarningCode#INVALID_AS SIGNMENT] | 2416 * This hint is generated anywhere where the [StaticTypeWarningCode#INVALID_AS SIGNMENT] |
| 2417 * would have been generated, if we used propagated information for the warnin gs. | 2417 * would have been generated, if we used propagated information for the warnin gs. |
| 2418 * | 2418 * |
| 2419 * @param rhsTypeName the name of the right hand side type | 2419 * @param rhsTypeName the name of the right hand side type |
| 2420 * @param lhsTypeName the name of the left hand side type | 2420 * @param lhsTypeName the name of the left hand side type |
| 2421 * @see StaticTypeWarningCode#INVALID_ASSIGNMENT | 2421 * @see StaticTypeWarningCode#INVALID_ASSIGNMENT |
| 2422 */ | 2422 */ |
| 2423 static const HintCode INVALID_ASSIGNMENT = const HintCode.con1('INVALID_ASSIGN MENT', 12, "A value of type '%s' cannot be assigned to a variable of type '%s'") ; | 2423 static const HintCode INVALID_ASSIGNMENT = const HintCode.con1("INVALID_ASSIGN MENT", 12, "A value of type '{0}' cannot be assigned to a variable of type '{1}' "); |
| 2424 | 2424 |
| 2425 /** | 2425 /** |
| 2426 * Generate a hint for methods or functions that have a return type, but do no t have a non-void | 2426 * Generate a hint for methods or functions that have a return type, but do no t have a non-void |
| 2427 * return statement on all branches. At the end of methods or functions with n o return, Dart | 2427 * return statement on all branches. At the end of methods or functions with n o return, Dart |
| 2428 * implicitly returns `null`, avoiding these implicit returns is considered a best practice. | 2428 * implicitly returns `null`, avoiding these implicit returns is considered a best practice. |
| 2429 * | 2429 * |
| 2430 * @param returnType the name of the declared return type | 2430 * @param returnType the name of the declared return type |
| 2431 */ | 2431 */ |
| 2432 static const HintCode MISSING_RETURN = const HintCode.con2('MISSING_RETURN', 1 3, "This function declares a return type of '%s', but does not end with a return statement", "Either add a return statement or change the return type to 'void'" ); | 2432 static const HintCode MISSING_RETURN = const HintCode.con2("MISSING_RETURN", 1 3, "This function declares a return type of '{0}', but does not end with a retur n statement", "Either add a return statement or change the return type to 'void' "); |
| 2433 | 2433 |
| 2434 /** | 2434 /** |
| 2435 * A getter with the override annotation does not override an existing getter. | 2435 * A getter with the override annotation does not override an existing getter. |
| 2436 */ | 2436 */ |
| 2437 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_GETTER', 14, "Getter does not override an inherited getter"); | 2437 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode.con1( "OVERRIDE_ON_NON_OVERRIDING_GETTER", 14, "Getter does not override an inherited getter"); |
| 2438 | 2438 |
| 2439 /** | 2439 /** |
| 2440 * A method with the override annotation does not override an existing method. | 2440 * A method with the override annotation does not override an existing method. |
| 2441 */ | 2441 */ |
| 2442 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_METHOD', 15, "Method does not override an inherited method"); | 2442 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode.con1( "OVERRIDE_ON_NON_OVERRIDING_METHOD", 15, "Method does not override an inherited method"); |
| 2443 | 2443 |
| 2444 /** | 2444 /** |
| 2445 * A setter with the override annotation does not override an existing setter. | 2445 * A setter with the override annotation does not override an existing setter. |
| 2446 */ | 2446 */ |
| 2447 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_SETTER', 16, "Setter does not override an inherited setter"); | 2447 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode.con1( "OVERRIDE_ON_NON_OVERRIDING_SETTER", 16, "Setter does not override an inherited setter"); |
| 2448 | 2448 |
| 2449 /** | 2449 /** |
| 2450 * Hint for classes that override equals, but not hashCode. | 2450 * Hint for classes that override equals, but not hashCode. |
| 2451 * | 2451 * |
| 2452 * @param className the name of the current class | 2452 * @param className the name of the current class |
| 2453 */ | 2453 */ |
| 2454 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode.con1( 'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 17, "The class '%s' overrides 'operator==', but not 'get hashCode'"); | 2454 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode.con1( "OVERRIDE_EQUALS_BUT_NOT_HASH_CODE", 17, "The class '{0}' overrides 'operator==' , but not 'get hashCode'"); |
| 2455 | 2455 |
| 2456 /** | 2456 /** |
| 2457 * Type checks of the type `x is! Null` should be done with `x != null`. | 2457 * Type checks of the type `x is! Null` should be done with `x != null`. |
| 2458 */ | 2458 */ |
| 2459 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode.con1('TYPE_CHECK _IS_NOT_NULL', 18, "Tests for non-null should be done with '!= null'"); | 2459 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode.con1("TYPE_CHECK _IS_NOT_NULL", 18, "Tests for non-null should be done with '!= null'"); |
| 2460 | 2460 |
| 2461 /** | 2461 /** |
| 2462 * Type checks of the type `x is Null` should be done with `x == null`. | 2462 * Type checks of the type `x is Null` should be done with `x == null`. |
| 2463 */ | 2463 */ |
| 2464 static const HintCode TYPE_CHECK_IS_NULL = const HintCode.con1('TYPE_CHECK_IS_ NULL', 19, "Tests for null should be done with '== null'"); | 2464 static const HintCode TYPE_CHECK_IS_NULL = const HintCode.con1("TYPE_CHECK_IS_ NULL", 19, "Tests for null should be done with '== null'"); |
| 2465 | 2465 |
| 2466 /** | 2466 /** |
| 2467 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ GETTER] or | 2467 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ GETTER] or |
| 2468 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used propagated | 2468 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used propagated |
| 2469 * information for the warnings. | 2469 * information for the warnings. |
| 2470 * | 2470 * |
| 2471 * @param getterName the name of the getter | 2471 * @param getterName the name of the getter |
| 2472 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for | 2472 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for |
| 2473 * @see StaticTypeWarningCode#UNDEFINED_GETTER | 2473 * @see StaticTypeWarningCode#UNDEFINED_GETTER |
| 2474 * @see StaticWarningCode#UNDEFINED_GETTER | 2474 * @see StaticWarningCode#UNDEFINED_GETTER |
| 2475 */ | 2475 */ |
| 2476 static const HintCode UNDEFINED_GETTER = const HintCode.con1('UNDEFINED_GETTER ', 20, "There is no such getter '%s' in '%s'"); | 2476 static const HintCode UNDEFINED_GETTER = const HintCode.con1("UNDEFINED_GETTER ", 20, "There is no such getter '{0}' in '{1}'"); |
| 2477 | 2477 |
| 2478 /** | 2478 /** |
| 2479 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ METHOD] would | 2479 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ METHOD] would |
| 2480 * have been generated, if we used propagated information for the warnings. | 2480 * have been generated, if we used propagated information for the warnings. |
| 2481 * | 2481 * |
| 2482 * @param methodName the name of the method that is undefined | 2482 * @param methodName the name of the method that is undefined |
| 2483 * @param typeName the resolved type name that the method lookup is happening on | 2483 * @param typeName the resolved type name that the method lookup is happening on |
| 2484 * @see StaticTypeWarningCode#UNDEFINED_METHOD | 2484 * @see StaticTypeWarningCode#UNDEFINED_METHOD |
| 2485 */ | 2485 */ |
| 2486 static const HintCode UNDEFINED_METHOD = const HintCode.con1('UNDEFINED_METHOD ', 21, "The method '%s' is not defined for the class '%s'"); | 2486 static const HintCode UNDEFINED_METHOD = const HintCode.con1("UNDEFINED_METHOD ", 21, "The method '{0}' is not defined for the class '{1}'"); |
| 2487 | 2487 |
| 2488 /** | 2488 /** |
| 2489 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ OPERATOR] | 2489 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ OPERATOR] |
| 2490 * would have been generated, if we used propagated information for the warnin gs. | 2490 * would have been generated, if we used propagated information for the warnin gs. |
| 2491 * | 2491 * |
| 2492 * @param operator the name of the operator | 2492 * @param operator the name of the operator |
| 2493 * @param enclosingType the name of the enclosing type where the operator is b eing looked for | 2493 * @param enclosingType the name of the enclosing type where the operator is b eing looked for |
| 2494 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR | 2494 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR |
| 2495 */ | 2495 */ |
| 2496 static const HintCode UNDEFINED_OPERATOR = const HintCode.con1('UNDEFINED_OPER ATOR', 22, "There is no such operator '%s' in '%s'"); | 2496 static const HintCode UNDEFINED_OPERATOR = const HintCode.con1("UNDEFINED_OPER ATOR", 22, "There is no such operator '{0}' in '{1}'"); |
| 2497 | 2497 |
| 2498 /** | 2498 /** |
| 2499 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ SETTER] or | 2499 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ SETTER] or |
| 2500 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used propagated | 2500 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used propagated |
| 2501 * information for the warnings. | 2501 * information for the warnings. |
| 2502 * | 2502 * |
| 2503 * @param setterName the name of the setter | 2503 * @param setterName the name of the setter |
| 2504 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for | 2504 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for |
| 2505 * @see StaticTypeWarningCode#UNDEFINED_SETTER | 2505 * @see StaticTypeWarningCode#UNDEFINED_SETTER |
| 2506 * @see StaticWarningCode#UNDEFINED_SETTER | 2506 * @see StaticWarningCode#UNDEFINED_SETTER |
| 2507 */ | 2507 */ |
| 2508 static const HintCode UNDEFINED_SETTER = const HintCode.con1('UNDEFINED_SETTER ', 23, "There is no such setter '%s' in '%s'"); | 2508 static const HintCode UNDEFINED_SETTER = const HintCode.con1("UNDEFINED_SETTER ", 23, "There is no such setter '{0}' in '{1}'"); |
| 2509 | 2509 |
| 2510 /** | 2510 /** |
| 2511 * Unnecessary cast. | 2511 * Unnecessary cast. |
| 2512 */ | 2512 */ |
| 2513 static const HintCode UNNECESSARY_CAST = const HintCode.con1('UNNECESSARY_CAST ', 24, "Unnecessary cast"); | 2513 static const HintCode UNNECESSARY_CAST = const HintCode.con1("UNNECESSARY_CAST ", 24, "Unnecessary cast"); |
| 2514 | 2514 |
| 2515 /** | 2515 /** |
| 2516 * Unnecessary type checks, the result is always true. | 2516 * Unnecessary type checks, the result is always true. |
| 2517 */ | 2517 */ |
| 2518 static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode.con1('UNNE CESSARY_TYPE_CHECK_FALSE', 25, "Unnecessary type check, the result is always fal se"); | 2518 static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode.con1("UNNE CESSARY_TYPE_CHECK_FALSE", 25, "Unnecessary type check, the result is always fal se"); |
| 2519 | 2519 |
| 2520 /** | 2520 /** |
| 2521 * Unnecessary type checks, the result is always false. | 2521 * Unnecessary type checks, the result is always false. |
| 2522 */ | 2522 */ |
| 2523 static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode.con1('UNNEC ESSARY_TYPE_CHECK_TRUE', 26, "Unnecessary type check, the result is always true" ); | 2523 static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode.con1("UNNEC ESSARY_TYPE_CHECK_TRUE", 26, "Unnecessary type check, the result is always true" ); |
| 2524 | 2524 |
| 2525 /** | 2525 /** |
| 2526 * Unused imports are imports which are never not used. | 2526 * Unused imports are imports which are never not used. |
| 2527 */ | 2527 */ |
| 2528 static const HintCode UNUSED_IMPORT = const HintCode.con1('UNUSED_IMPORT', 27, "Unused import"); | 2528 static const HintCode UNUSED_IMPORT = const HintCode.con1("UNUSED_IMPORT", 27, "Unused import"); |
| 2529 | 2529 |
| 2530 /** | 2530 /** |
| 2531 * Hint for cases where the source expects a method or function to return a no n-void result, but | 2531 * Hint for cases where the source expects a method or function to return a no n-void result, but |
| 2532 * the method or function signature returns void. | 2532 * the method or function signature returns void. |
| 2533 * | 2533 * |
| 2534 * @param name the name of the method or function that returns void | 2534 * @param name the name of the method or function that returns void |
| 2535 */ | 2535 */ |
| 2536 static const HintCode USE_OF_VOID_RESULT = const HintCode.con1('USE_OF_VOID_RE SULT', 28, "The result of '%s' is being used, even though it is declared to be ' void'"); | 2536 static const HintCode USE_OF_VOID_RESULT = const HintCode.con1("USE_OF_VOID_RE SULT", 28, "The result of '{0}' is being used, even though it is declared to be 'void'"); |
| 2537 | 2537 |
| 2538 static const List<HintCode> values = const [ | 2538 static const List<HintCode> values = const [ |
| 2539 ARGUMENT_TYPE_NOT_ASSIGNABLE, | 2539 ARGUMENT_TYPE_NOT_ASSIGNABLE, |
| 2540 DEAD_CODE, | 2540 DEAD_CODE, |
| 2541 DEAD_CODE_CATCH_FOLLOWING_CATCH, | 2541 DEAD_CODE_CATCH_FOLLOWING_CATCH, |
| 2542 DEAD_CODE_ON_CATCH_SUBTYPE, | 2542 DEAD_CODE_ON_CATCH_SUBTYPE, |
| 2543 DEPRECATED_MEMBER_USE, | 2543 DEPRECATED_MEMBER_USE, |
| 2544 DUPLICATE_IMPORT, | 2544 DUPLICATE_IMPORT, |
| 2545 DIVISION_OPTIMIZATION, | 2545 DIVISION_OPTIMIZATION, |
| 2546 IS_DOUBLE, | 2546 IS_DOUBLE, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2608 * caused the error to be generated and for the error message to explain what is wrong and, when | 2608 * caused the error to be generated and for the error message to explain what is wrong and, when |
| 2609 * appropriate, how the problem can be corrected. | 2609 * appropriate, how the problem can be corrected. |
| 2610 */ | 2610 */ |
| 2611 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { | 2611 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { |
| 2612 /** | 2612 /** |
| 2613 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag is not a | 2613 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag is not a |
| 2614 * valid URI. | 2614 * valid URI. |
| 2615 * | 2615 * |
| 2616 * @param uri the URI that is invalid | 2616 * @param uri the URI that is invalid |
| 2617 */ | 2617 */ |
| 2618 static const HtmlWarningCode INVALID_URI = const HtmlWarningCode.con1('INVALID _URI', 0, "Invalid URI syntax: '%s'"); | 2618 static const HtmlWarningCode INVALID_URI = const HtmlWarningCode.con1("INVALID _URI", 0, "Invalid URI syntax: '{0}'"); |
| 2619 | 2619 |
| 2620 /** | 2620 /** |
| 2621 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag references | 2621 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag references |
| 2622 * a file that does not exist. | 2622 * a file that does not exist. |
| 2623 * | 2623 * |
| 2624 * @param uri the URI pointing to a non-existent file | 2624 * @param uri the URI pointing to a non-existent file |
| 2625 */ | 2625 */ |
| 2626 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode.con1(' URI_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'"); | 2626 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode.con1(" URI_DOES_NOT_EXIST", 1, "Target of URI does not exist: '{0}'"); |
| 2627 | 2627 |
| 2628 static const List<HtmlWarningCode> values = const [INVALID_URI, URI_DOES_NOT_E XIST]; | 2628 static const List<HtmlWarningCode> values = const [INVALID_URI, URI_DOES_NOT_E XIST]; |
| 2629 | 2629 |
| 2630 /** | 2630 /** |
| 2631 * The template used to create the message to be displayed for this error. | 2631 * The template used to create the message to be displayed for this error. |
| 2632 */ | 2632 */ |
| 2633 final String message; | 2633 final String message; |
| 2634 | 2634 |
| 2635 /** | 2635 /** |
| 2636 * The template used to create the correction to be displayed for this error, or `null` if | 2636 * The template used to create the correction to be displayed for this error, or `null` if |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 2660 ErrorType get type => ErrorType.STATIC_WARNING; | 2660 ErrorType get type => ErrorType.STATIC_WARNING; |
| 2661 | 2661 |
| 2662 @override | 2662 @override |
| 2663 String get uniqueName => "${runtimeType.toString()}.${name}"; | 2663 String get uniqueName => "${runtimeType.toString()}.${name}"; |
| 2664 } | 2664 } |
| 2665 | 2665 |
| 2666 /** | 2666 /** |
| 2667 * The enumeration `PolymerCode` defines Polymer specific problems. | 2667 * The enumeration `PolymerCode` defines Polymer specific problems. |
| 2668 */ | 2668 */ |
| 2669 class PolymerCode extends Enum<PolymerCode> implements ErrorCode { | 2669 class PolymerCode extends Enum<PolymerCode> implements ErrorCode { |
| 2670 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('AT TRIBUTE_FIELD_NOT_PUBLISHED', 0, "Field '%s' in '%s' must be @published"); | 2670 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode("AT TRIBUTE_FIELD_NOT_PUBLISHED", 0, "Field '{0}' in '{1}' must be @published"); |
| 2671 | 2671 |
| 2672 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('D UPLICATE_ATTRIBUTE_DEFINITION', 1, "The attribute '%s' is already defined"); | 2672 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode("D UPLICATE_ATTRIBUTE_DEFINITION", 1, "The attribute '{0}' is already defined"); |
| 2673 | 2673 |
| 2674 static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode('EMPTY_ATTRIBUTE S', 2, "Empty 'attributes' attribute is useless"); | 2674 static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode("EMPTY_ATTRIBUTE S", 2, "Empty 'attributes' attribute is useless"); |
| 2675 | 2675 |
| 2676 static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode('INVALID_A TTRIBUTE_NAME', 3, "'%s' is not a valid name for a custom element attribute"); | 2676 static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode("INVALID_A TTRIBUTE_NAME", 3, "'{0}' is not a valid name for a custom element attribute"); |
| 2677 | 2677 |
| 2678 static const PolymerCode INVALID_TAG_NAME = const PolymerCode('INVALID_TAG_NAM E', 4, "'%s' is not a valid name for a custom element"); | 2678 static const PolymerCode INVALID_TAG_NAME = const PolymerCode("INVALID_TAG_NAM E", 4, "'{0}' is not a valid name for a custom element"); |
| 2679 | 2679 |
| 2680 static const PolymerCode MISSING_TAG_NAME = const PolymerCode('MISSING_TAG_NAM E', 5, "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'"); | 2680 static const PolymerCode MISSING_TAG_NAME = const PolymerCode("MISSING_TAG_NAM E", 5, "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'"); |
| 2681 | 2681 |
| 2682 static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode('UNDEFI NED_ATTRIBUTE_FIELD', 6, "There is no such field '%s' in '%s'"); | 2682 static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode("UNDEFI NED_ATTRIBUTE_FIELD", 6, "There is no such field '{0}' in '{1}'"); |
| 2683 | 2683 |
| 2684 static const List<PolymerCode> values = const [ | 2684 static const List<PolymerCode> values = const [ |
| 2685 ATTRIBUTE_FIELD_NOT_PUBLISHED, | 2685 ATTRIBUTE_FIELD_NOT_PUBLISHED, |
| 2686 DUPLICATE_ATTRIBUTE_DEFINITION, | 2686 DUPLICATE_ATTRIBUTE_DEFINITION, |
| 2687 EMPTY_ATTRIBUTES, | 2687 EMPTY_ATTRIBUTES, |
| 2688 INVALID_ATTRIBUTE_NAME, | 2688 INVALID_ATTRIBUTE_NAME, |
| 2689 INVALID_TAG_NAME, | 2689 INVALID_TAG_NAME, |
| 2690 MISSING_TAG_NAME, | 2690 MISSING_TAG_NAME, |
| 2691 UNDEFINED_ATTRIBUTE_FIELD]; | 2691 UNDEFINED_ATTRIBUTE_FIELD]; |
| 2692 | 2692 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 2721 * indicate the problem that caused the suggestion to be generated and for the m essage to explain | 2721 * indicate the problem that caused the suggestion to be generated and for the m essage to explain |
| 2722 * what is wrong and, when appropriate, how the situation can be corrected. | 2722 * what is wrong and, when appropriate, how the situation can be corrected. |
| 2723 */ | 2723 */ |
| 2724 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { | 2724 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { |
| 2725 /** | 2725 /** |
| 2726 * It is a bad practice for a source file in a package "lib" directory hierarc hy to traverse | 2726 * It is a bad practice for a source file in a package "lib" directory hierarc hy to traverse |
| 2727 * outside that directory hierarchy. For example, a source file in the "lib" d irectory should not | 2727 * outside that directory hierarchy. For example, a source file in the "lib" d irectory should not |
| 2728 * contain a directive such as `import '../web/some.dart'` which references a file outside | 2728 * contain a directive such as `import '../web/some.dart'` which references a file outside |
| 2729 * the lib directory. | 2729 * the lib directory. |
| 2730 */ | 2730 */ |
| 2731 static const PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const PubSuggestionCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy"); | 2731 static const PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const PubSuggestionCode.con1("FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE", 0, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy"); |
| 2732 | 2732 |
| 2733 /** | 2733 /** |
| 2734 * It is a bad practice for a source file ouside a package "lib" directory hie rarchy to traverse | 2734 * It is a bad practice for a source file ouside a package "lib" directory hie rarchy to traverse |
| 2735 * into that directory hierarchy. For example, a source file in the "web" dire ctory should not | 2735 * into that directory hierarchy. For example, a source file in the "web" dire ctory should not |
| 2736 * contain a directive such as `import '../lib/some.dart'` which references a file inside | 2736 * contain a directive such as `import '../lib/some.dart'` which references a file inside |
| 2737 * the lib directory. | 2737 * the lib directory. |
| 2738 */ | 2738 */ |
| 2739 static const PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const PubSuggestionCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1, "A file outside the 'lib' directory hierarchy should not reference a file in side that hierarchy. Use a package: reference instead."); | 2739 static const PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const PubSuggestionCode.con1("FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE", 1, "A file outside the 'lib' directory hierarchy should not reference a file in side that hierarchy. Use a package: reference instead."); |
| 2740 | 2740 |
| 2741 /** | 2741 /** |
| 2742 * It is a bad practice for a package import to reference anything outside the given package, or | 2742 * It is a bad practice for a package import to reference anything outside the given package, or |
| 2743 * more generally, it is bad practice for a package import to contain a "..". For example, a | 2743 * more generally, it is bad practice for a package import to contain a "..". For example, a |
| 2744 * source file should not contain a directive such as `import 'package:foo/../ some.dart'`. | 2744 * source file should not contain a directive such as `import 'package:foo/../ some.dart'`. |
| 2745 */ | 2745 */ |
| 2746 static const PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const PubSugg estionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should n ot contain '..'"); | 2746 static const PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const PubSugg estionCode.con1("PACKAGE_IMPORT_CONTAINS_DOT_DOT", 2, "A package import should n ot contain '..'"); |
| 2747 | 2747 |
| 2748 static const List<PubSuggestionCode> values = const [ | 2748 static const List<PubSuggestionCode> values = const [ |
| 2749 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, | 2749 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, |
| 2750 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, | 2750 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, |
| 2751 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; | 2751 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; |
| 2752 | 2752 |
| 2753 /** | 2753 /** |
| 2754 * The template used to create the message to be displayed for this error. | 2754 * The template used to create the message to be displayed for this error. |
| 2755 */ | 2755 */ |
| 2756 final String message; | 2756 final String message; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2792 * that caused the error to be generated and for the error message to explain wh at is wrong and, | 2792 * that caused the error to be generated and for the error message to explain wh at is wrong and, |
| 2793 * when appropriate, how the problem can be corrected. | 2793 * when appropriate, how the problem can be corrected. |
| 2794 */ | 2794 */ |
| 2795 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code { | 2795 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code { |
| 2796 /** | 2796 /** |
| 2797 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas s implements the | 2797 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas s implements the |
| 2798 * built-in class <i>List<E></i> is allocated. | 2798 * built-in class <i>List<E></i> is allocated. |
| 2799 * | 2799 * |
| 2800 * @param numTypeArgument the number of provided type arguments | 2800 * @param numTypeArgument the number of provided type arguments |
| 2801 */ | 2801 */ |
| 2802 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const St aticTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal re quires exactly one type arguments or none, but %d found"); | 2802 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const St aticTypeWarningCode.con1("EXPECTED_ONE_LIST_TYPE_ARGUMENTS", 0, "List literal re quires exactly one type arguments or none, but {0} found"); |
| 2803 | 2803 |
| 2804 /** | 2804 /** |
| 2805 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the | 2805 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the |
| 2806 * built-in class <i>Map<K, V></i> is allocated. | 2806 * built-in class <i>Map<K, V></i> is allocated. |
| 2807 * | 2807 * |
| 2808 * @param numTypeArgument the number of provided type arguments | 2808 * @param numTypeArgument the number of provided type arguments |
| 2809 */ | 2809 */ |
| 2810 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta ticTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal requi res exactly two type arguments or none, but %d found"); | 2810 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta ticTypeWarningCode.con1("EXPECTED_TWO_MAP_TYPE_ARGUMENTS", 1, "Map literal requi res exactly two type arguments or none, but {0} found"); |
| 2811 | 2811 |
| 2812 /** | 2812 /** |
| 2813 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type | 2813 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type |
| 2814 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. | 2814 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. |
| 2815 * | 2815 * |
| 2816 * @see #UNDEFINED_SETTER | 2816 * @see #UNDEFINED_SETTER |
| 2817 */ | 2817 */ |
| 2818 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni ngCode.con1('INACCESSIBLE_SETTER', 2, ""); | 2818 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni ngCode.con1("INACCESSIBLE_SETTER", 2, ""); |
| 2819 | 2819 |
| 2820 /** | 2820 /** |
| 2821 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause m ultiple members | 2821 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause m ultiple members |
| 2822 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the same name <i>n</i> t hat would be | 2822 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the same name <i>n</i> t hat would be |
| 2823 * inherited (because identically named members existed in several superinterf aces) then at most | 2823 * inherited (because identically named members existed in several superinterf aces) then at most |
| 2824 * one member is inherited. | 2824 * one member is inherited. |
| 2825 * | 2825 * |
| 2826 * If the static types <i>T<sub>1</sub>, …, T<sub>k</sub></i> of the me mbers | 2826 * If the static types <i>T<sub>1</sub>, …, T<sub>k</sub></i> of the me mbers |
| 2827 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> are not identical, then there must be a member | 2827 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> are not identical, then there must be a member |
| 2828 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> <: T<sub>i</sub>, 1 < = x <= k</i> for | 2828 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> <: T<sub>i</sub>, 1 < = x <= k</i> for |
| 2829 * all <i>i, 1 <= i <= k</i>, or a static type warning occurs. The membe r that is inherited | 2829 * all <i>i, 1 <= i <= k</i>, or a static type warning occurs. The membe r that is inherited |
| 2830 * is <i>m<sub>x</sub></i>, if it exists; otherwise: | 2830 * is <i>m<sub>x</sub></i>, if it exists; otherwise: |
| 2831 * * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional parameters of a | 2831 * * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional parameters of a |
| 2832 * function <i>f</i>, and let <i>numberOfRequiredParams</i>(<i>f</i>) denote t he number of | 2832 * function <i>f</i>, and let <i>numberOfRequiredParams</i>(<i>f</i>) denote t he number of |
| 2833 * required parameters of a function <i>f</i>. Furthermore, let <i>s</i> denot e the set of all | 2833 * required parameters of a function <i>f</i>. Furthermore, let <i>s</i> denot e the set of all |
| 2834 * named parameters of the <i>m<sub>1</sub>, …, m<sub>k</sub></i>. Then let | 2834 * named parameters of the <i>m<sub>1</sub>, …, m<sub>k</sub></i>. Then let |
| 2835 * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i> | 2835 * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i> |
| 2836 * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <= i <= k.</i> | 2836 * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <= i <= k.</i> |
| 2837 * If <i>r <= h</i> then <i>I</i> has a method named <i>n</i>, with <i>r</i> r equired parameters | 2837 * If <i>r <= h</i> then <i>I</i> has a method named <i>n</i>, with <i>r</i> r equired parameters |
| 2838 * of type <b>dynamic</b>, <i>h</i> positional parameters of type <b>dynamic</ b>, named parameters | 2838 * of type <b>dynamic</b>, <i>h</i> positional parameters of type <b>dynamic</ b>, named parameters |
| 2839 * <i>s</i> of type <b>dynamic</b> and return type <b>dynamic</b>. | 2839 * <i>s</i> of type <b>dynamic</b> and return type <b>dynamic</b>. |
| 2840 * * Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub></ i> is inherited. | 2840 * * Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub></ i> is inherited. |
| 2841 */ | 2841 */ |
| 2842 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta ticTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'%s' is inherited by at least two interfaces inconsistently, from %s"); | 2842 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta ticTypeWarningCode.con1("INCONSISTENT_METHOD_INHERITANCE", 3, "'{0}' is inherite d by at least two interfaces inconsistently, from {1}"); |
| 2843 | 2843 |
| 2844 /** | 2844 /** |
| 2845 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an | 2845 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an |
| 2846 * accessible (3.2) instance member named <i>m</i>. | 2846 * accessible (3.2) instance member named <i>m</i>. |
| 2847 * | 2847 * |
| 2848 * @param memberName the name of the static member | 2848 * @param memberName the name of the static member |
| 2849 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER | 2849 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER |
| 2850 */ | 2850 */ |
| 2851 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St aticTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member ' %s' cannot be accessed using instance access"); | 2851 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St aticTypeWarningCode.con1("INSTANCE_ACCESS_TO_STATIC_MEMBER", 4, "Static member ' {0}' cannot be accessed using instance access"); |
| 2852 | 2852 |
| 2853 /** | 2853 /** |
| 2854 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be | 2854 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be |
| 2855 * assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the | 2855 * assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the |
| 2856 * static type of <i>e</i>. | 2856 * static type of <i>e</i>. |
| 2857 * | 2857 * |
| 2858 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be | 2858 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be |
| 2859 * assigned to the static type of <i>C.v</i>. The static type of the expressio n <i>C.v = e</i> is | 2859 * assigned to the static type of <i>C.v</i>. The static type of the expressio n <i>C.v = e</i> is |
| 2860 * the static type of <i>e</i>. | 2860 * the static type of <i>e</i>. |
| 2861 * | 2861 * |
| 2862 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type | 2862 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type |
| 2863 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to < i>T</i>. | 2863 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to < i>T</i>. |
| 2864 * | 2864 * |
| 2865 * @param rhsTypeName the name of the right hand side type | 2865 * @param rhsTypeName the name of the right hand side type |
| 2866 * @param lhsTypeName the name of the left hand side type | 2866 * @param lhsTypeName the name of the left hand side type |
| 2867 */ | 2867 */ |
| 2868 static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarnin gCode.con1('INVALID_ASSIGNMENT', 5, "A value of type '%s' cannot be assigned to a variable of type '%s'"); | 2868 static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarnin gCode.con1("INVALID_ASSIGNMENT", 5, "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); |
| 2869 | 2869 |
| 2870 /** | 2870 /** |
| 2871 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form | 2871 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form |
| 2872 * <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, … | 2872 * <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, … |
| 2873 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. | 2873 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. |
| 2874 * | 2874 * |
| 2875 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not | 2875 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not |
| 2876 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning | 2876 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning |
| 2877 * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does | 2877 * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does |
| 2878 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</ i> is dynamic. | 2878 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</ i> is dynamic. |
| 2879 * | 2879 * |
| 2880 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may | 2880 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may |
| 2881 * not be assigned to a function type. | 2881 * not be assigned to a function type. |
| 2882 * | 2882 * |
| 2883 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 2883 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
| 2884 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, … | 2884 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, … |
| 2885 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static warning if the type | 2885 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static warning if the type |
| 2886 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. | 2886 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. |
| 2887 * | 2887 * |
| 2888 * @param nonFunctionIdentifier the name of the identifier that is not a funct ion type | 2888 * @param nonFunctionIdentifier the name of the identifier that is not a funct ion type |
| 2889 */ | 2889 */ |
| 2890 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTy peWarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'%s' is not a method"); | 2890 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTy peWarningCode.con1("INVOCATION_OF_NON_FUNCTION", 6, "'{0}' is not a method"); |
| 2891 | 2891 |
| 2892 /** | 2892 /** |
| 2893 * 12.14.4 Function Expression Invocation: A function expression invocation <i >i</i> has the form | 2893 * 12.14.4 Function Expression Invocation: A function expression invocation <i >i</i> has the form |
| 2894 * <i>e<sub>f</sub>(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a <sub>n+1</sub>, | 2894 * <i>e<sub>f</sub>(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a <sub>n+1</sub>, |
| 2895 * …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression. | 2895 * …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression. |
| 2896 * | 2896 * |
| 2897 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub> </i> may not be | 2897 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub> </i> may not be |
| 2898 * assigned to a function type. | 2898 * assigned to a function type. |
| 2899 */ | 2899 */ |
| 2900 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = con st StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Canno t invoke a non-function"); | 2900 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = con st StaticTypeWarningCode.con1("INVOCATION_OF_NON_FUNCTION_EXPRESSION", 7, "Canno t invoke a non-function"); |
| 2901 | 2901 |
| 2902 /** | 2902 /** |
| 2903 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be | 2903 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be |
| 2904 * assigned to bool. | 2904 * assigned to bool. |
| 2905 * | 2905 * |
| 2906 * 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned | 2906 * 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned |
| 2907 * to bool. | 2907 * to bool. |
| 2908 * | 2908 * |
| 2909 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool. | 2909 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool. |
| 2910 * | 2910 * |
| 2911 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi gned to bool. | 2911 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi gned to bool. |
| 2912 */ | 2912 */ |
| 2913 static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarnin gCode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool '"); | 2913 static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarnin gCode.con1("NON_BOOL_CONDITION", 8, "Conditions must have a static type of 'bool '"); |
| 2914 | 2914 |
| 2915 /** | 2915 /** |
| 2916 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b e assigned to either | 2916 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b e assigned to either |
| 2917 * bool or () → bool | 2917 * bool or () → bool |
| 2918 */ | 2918 */ |
| 2919 static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarni ngCode.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '() -> bool'"); | 2919 static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarni ngCode.con1("NON_BOOL_EXPRESSION", 9, "Assertions must be on either a 'bool' or '() -> bool'"); |
| 2920 | 2920 |
| 2921 /** | 2921 /** |
| 2922 * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expr ession | 2922 * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expr ession |
| 2923 * <i>e</i>?<b>false<b> : <b>true</b>. | 2923 * <i>e</i>?<b>false<b> : <b>true</b>. |
| 2924 * | 2924 * |
| 2925 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be | 2925 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be |
| 2926 * assigned to bool. | 2926 * assigned to bool. |
| 2927 */ | 2927 */ |
| 2928 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const Static TypeWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must have a static type of 'bool'"); | 2928 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const Static TypeWarningCode.con1("NON_BOOL_NEGATION_EXPRESSION", 10, "Negation argument must have a static type of 'bool'"); |
| 2929 | 2929 |
| 2930 /** | 2930 /** |
| 2931 * 12.21 Logical Boolean Expressions: It is a static type warning if the stati c types of both of | 2931 * 12.21 Logical Boolean Expressions: It is a static type warning if the stati c types of both of |
| 2932 * <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may not be assigned to bool. | 2932 * <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may not be assigned to bool. |
| 2933 * | 2933 * |
| 2934 * @param operator the lexeme of the logical operator | 2934 * @param operator the lexeme of the logical operator |
| 2935 */ | 2935 */ |
| 2936 static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningC ode.con1('NON_BOOL_OPERAND', 11, "The operands of the '%s' operator must be assi gnable to 'bool'"); | 2936 static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningC ode.con1("NON_BOOL_OPERAND", 11, "The operands of the '{0}' operator must be ass ignable to 'bool'"); |
| 2937 | 2937 |
| 2938 /** | 2938 /** |
| 2939 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 <= i <= | 2939 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 <= i <= |
| 2940 * n</i> does not denote a type in the enclosing lexical scope. | 2940 * n</i> does not denote a type in the enclosing lexical scope. |
| 2941 */ | 2941 */ |
| 2942 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTyp eWarningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 12, "The name '%s' is not a type and cannot be used as a parameterized type"); | 2942 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTyp eWarningCode.con1("NON_TYPE_AS_TYPE_ARGUMENT", 12, "The name '{0}' is not a type and cannot be used as a parameterized type"); |
| 2943 | 2943 |
| 2944 /** | 2944 /** |
| 2945 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b e assigned to the | 2945 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b e assigned to the |
| 2946 * declared return type of the immediately enclosing function. | 2946 * declared return type of the immediately enclosing function. |
| 2947 * | 2947 * |
| 2948 * @param actualReturnType the return type as declared in the return statement | 2948 * @param actualReturnType the return type as declared in the return statement |
| 2949 * @param expectedReturnType the expected return type as defined by the method | 2949 * @param expectedReturnType the expected return type as defined by the method |
| 2950 * @param methodName the name of the method | 2950 * @param methodName the name of the method |
| 2951 */ | 2951 */ |
| 2952 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWa rningCode.con1('RETURN_OF_INVALID_TYPE', 13, "The return type '%s' is not a '%s' , as defined by the method '%s'"); | 2952 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWa rningCode.con1("RETURN_OF_INVALID_TYPE", 13, "The return type '{0}' is not a '{1 }', as defined by the method '{2}'"); |
| 2953 | 2953 |
| 2954 /** | 2954 /** |
| 2955 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a | 2955 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a |
| 2956 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object | 2956 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object |
| 2957 * expression are not subtypes of the bounds of the corresponding formal type parameters of | 2957 * expression are not subtypes of the bounds of the corresponding formal type parameters of |
| 2958 * <i>G</i>. | 2958 * <i>G</i>. |
| 2959 * | 2959 * |
| 2960 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</ i> of <i>G</i>, then | 2960 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</ i> of <i>G</i>, then |
| 2961 * the static type of the member <i>m</i> of <i>G<A<sub>1</sub>, …, | 2961 * the static type of the member <i>m</i> of <i>G<A<sub>1</sub>, …, |
| 2962 * A<sub>n</sub>></i> is <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1 </sub>, …, | 2962 * A<sub>n</sub>></i> is <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1 </sub>, …, |
| 2963 * T<sub>n</sub>]S</i> where <i>T<sub>1</sub>, …, T<sub>n</sub></i> are the formal type | 2963 * T<sub>n</sub>]S</i> where <i>T<sub>1</sub>, …, T<sub>n</sub></i> are the formal type |
| 2964 * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub> i</sub>, 1 <= i | 2964 * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub> i</sub>, 1 <= i |
| 2965 * <= n</i>. It is a static type warning if <i>A<sub>i</sub></i> is not a s ubtype of | 2965 * <= n</i>. It is a static type warning if <i>A<sub>i</sub></i> is not a s ubtype of |
| 2966 * <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1</sub>, …, | 2966 * <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1</sub>, …, |
| 2967 * T<sub>n</sub>]B<sub>i</sub>, 1 <= i <= n</i>. | 2967 * T<sub>n</sub>]B<sub>i</sub>, 1 <= i <= n</i>. |
| 2968 * | 2968 * |
| 2969 * 7.6.2 Factories: It is a static type warning if any of the type arguments t o <i>k'</i> are not | 2969 * 7.6.2 Factories: It is a static type warning if any of the type arguments t o <i>k'</i> are not |
| 2970 * subtypes of the bounds of the corresponding formal type parameters of type. | 2970 * subtypes of the bounds of the corresponding formal type parameters of type. |
| 2971 * | 2971 * |
| 2972 * @param boundedTypeName the name of the type used in the instance creation t hat should be | 2972 * @param boundedTypeName the name of the type used in the instance creation t hat should be |
| 2973 * limited by the bound as specified in the class declaration | 2973 * limited by the bound as specified in the class declaration |
| 2974 * @param boundingTypeName the name of the bounding type | 2974 * @param boundingTypeName the name of the bounding type |
| 2975 * @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND | 2975 * @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND |
| 2976 */ | 2976 */ |
| 2977 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S taticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 14, "'%s' does no t extend '%s'"); | 2977 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S taticTypeWarningCode.con1("TYPE_ARGUMENT_NOT_MATCHING_BOUNDS", 14, "'{0}' does n ot extend '{1}'"); |
| 2978 | 2978 |
| 2979 /** | 2979 /** |
| 2980 * 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound. | 2980 * 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound. |
| 2981 * | 2981 * |
| 2982 * @param typeParameterName the name of the type parameter | 2982 * @param typeParameterName the name of the type parameter |
| 2983 * @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS | 2983 * @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS |
| 2984 */ | 2984 */ |
| 2985 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con st StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 15, "'%s' cannot be a supertype of its upper bound"); | 2985 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con st StaticTypeWarningCode.con1("TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND", 15, "'{0} ' cannot be a supertype of its upper bound"); |
| 2986 | 2986 |
| 2987 /** | 2987 /** |
| 2988 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing | 2988 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing |
| 2989 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter | 2989 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter |
| 2990 * named <i>m</i>. | 2990 * named <i>m</i>. |
| 2991 * | 2991 * |
| 2992 * @param constantName the name of the enumeration constant that is not define d | 2992 * @param constantName the name of the enumeration constant that is not define d |
| 2993 * @param enumName the name of the enumeration used to access the constant | 2993 * @param enumName the name of the enumeration used to access the constant |
| 2994 */ | 2994 */ |
| 2995 static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeW arningCode.con1('UNDEFINED_ENUM_CONSTANT', 16, "There is no constant named '%s' in '%s'"); | 2995 static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeW arningCode.con1("UNDEFINED_ENUM_CONSTANT", 16, "There is no constant named '{0}' in '{1}'"); |
| 2996 | 2996 |
| 2997 /** | 2997 /** |
| 2998 * 12.15.3 Unqualified Invocation: If there exists a lexically visible declara tion named | 2998 * 12.15.3 Unqualified Invocation: If there exists a lexically visible declara tion named |
| 2999 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The n: [skip]. | 2999 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The n: [skip]. |
| 3000 * Otherwise, <i>f<sub>id</sub></i> is considered equivalent to the ordinary m ethod invocation | 3000 * Otherwise, <i>f<sub>id</sub></i> is considered equivalent to the ordinary m ethod invocation |
| 3001 * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>, <i>x <sub>n+1</sub></i> : | 3001 * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>, <i>x <sub>n+1</sub></i> : |
| 3002 * <i>a<sub>n+1</sub></i>, ..., <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i >). | 3002 * <i>a<sub>n+1</sub></i>, ..., <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i >). |
| 3003 * | 3003 * |
| 3004 * @param methodName the name of the method that is undefined | 3004 * @param methodName the name of the method that is undefined |
| 3005 */ | 3005 */ |
| 3006 static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarnin gCode.con1('UNDEFINED_FUNCTION', 17, "The function '%s' is not defined"); | 3006 static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarnin gCode.con1("UNDEFINED_FUNCTION", 17, "The function '{0}' is not defined"); |
| 3007 | 3007 |
| 3008 /** | 3008 /** |
| 3009 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type | 3009 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type |
| 3010 * warning if <i>T</i> does not have a getter named <i>m</i>. | 3010 * warning if <i>T</i> does not have a getter named <i>m</i>. |
| 3011 * | 3011 * |
| 3012 * @param getterName the name of the getter | 3012 * @param getterName the name of the getter |
| 3013 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for | 3013 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for |
| 3014 */ | 3014 */ |
| 3015 static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningC ode.con1('UNDEFINED_GETTER', 18, "There is no such getter '%s' in '%s'"); | 3015 static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningC ode.con1("UNDEFINED_GETTER", 18, "There is no such getter '{0}' in '{1}'"); |
| 3016 | 3016 |
| 3017 /** | 3017 /** |
| 3018 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type | 3018 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type |
| 3019 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. | 3019 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. |
| 3020 * | 3020 * |
| 3021 * @param methodName the name of the method that is undefined | 3021 * @param methodName the name of the method that is undefined |
| 3022 * @param typeName the resolved type name that the method lookup is happening on | 3022 * @param typeName the resolved type name that the method lookup is happening on |
| 3023 */ | 3023 */ |
| 3024 static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningC ode.con1('UNDEFINED_METHOD', 19, "The method '%s' is not defined for the class ' %s'"); | 3024 static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningC ode.con1("UNDEFINED_METHOD", 19, "The method '{0}' is not defined for the class '{1}'"); |
| 3025 | 3025 |
| 3026 /** | 3026 /** |
| 3027 * 12.18 Assignment: Evaluation of an assignment of the form | 3027 * 12.18 Assignment: Evaluation of an assignment of the form |
| 3028 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva lent to the | 3028 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva lent to the |
| 3029 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1< /sub></i>, | 3029 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1< /sub></i>, |
| 3030 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>). | 3030 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>). |
| 3031 * | 3031 * |
| 3032 * 12.29 Assignable Expressions: An assignable expression of the form | 3032 * 12.29 Assignable Expressions: An assignable expression of the form |
| 3033 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat ion of the operator | 3033 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat ion of the operator |
| 3034 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>. | 3034 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>. |
| 3035 * | 3035 * |
| 3036 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type | 3036 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type |
| 3037 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. | 3037 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. |
| 3038 * | 3038 * |
| 3039 * @param operator the name of the operator | 3039 * @param operator the name of the operator |
| 3040 * @param enclosingType the name of the enclosing type where the operator is b eing looked for | 3040 * @param enclosingType the name of the enclosing type where the operator is b eing looked for |
| 3041 */ | 3041 */ |
| 3042 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin gCode.con1('UNDEFINED_OPERATOR', 20, "There is no such operator '%s' in '%s'"); | 3042 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin gCode.con1("UNDEFINED_OPERATOR", 20, "There is no such operator '{0}' in '{1}'") ; |
| 3043 | 3043 |
| 3044 /** | 3044 /** |
| 3045 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type | 3045 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type |
| 3046 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. | 3046 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. |
| 3047 * | 3047 * |
| 3048 * @param setterName the name of the setter | 3048 * @param setterName the name of the setter |
| 3049 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for | 3049 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for |
| 3050 * @see #INACCESSIBLE_SETTER | 3050 * @see #INACCESSIBLE_SETTER |
| 3051 */ | 3051 */ |
| 3052 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC ode.con1('UNDEFINED_SETTER', 21, "There is no such setter '%s' in '%s'"); | 3052 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC ode.con1("UNDEFINED_SETTER", 21, "There is no such setter '{0}' in '{1}'"); |
| 3053 | 3053 |
| 3054 /** | 3054 /** |
| 3055 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 3055 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
| 3056 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, … | 3056 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, … |
| 3057 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S< /i> does not have an | 3057 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S< /i> does not have an |
| 3058 * accessible instance member named <i>m</i>. | 3058 * accessible instance member named <i>m</i>. |
| 3059 * | 3059 * |
| 3060 * @param methodName the name of the method that is undefined | 3060 * @param methodName the name of the method that is undefined |
| 3061 * @param typeName the resolved type name that the method lookup is happening on | 3061 * @param typeName the resolved type name that the method lookup is happening on |
| 3062 */ | 3062 */ |
| 3063 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWa rningCode.con1('UNDEFINED_SUPER_METHOD', 22, "There is no such method '%s' in '% s'"); | 3063 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWa rningCode.con1("UNDEFINED_SUPER_METHOD", 22, "There is no such method '{0}' in ' {1}'"); |
| 3064 | 3064 |
| 3065 /** | 3065 /** |
| 3066 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an | 3066 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an |
| 3067 * accessible (3.2) instance member named <i>m</i>. | 3067 * accessible (3.2) instance member named <i>m</i>. |
| 3068 * | 3068 * |
| 3069 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used when we are | 3069 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used when we are |
| 3070 * able to find the name defined in a supertype. It exists to provide a more i nformative error | 3070 * able to find the name defined in a supertype. It exists to provide a more i nformative error |
| 3071 * message. | 3071 * message. |
| 3072 */ | 3072 */ |
| 3073 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = const StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STA TIC_MEMBER', 23, "Static members from supertypes must be qualified by the name o f the defining type"); | 3073 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = const StaticTypeWarningCode.con1("UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STA TIC_MEMBER", 23, "Static members from supertypes must be qualified by the name o f the defining type"); |
| 3074 | 3074 |
| 3075 /** | 3075 /** |
| 3076 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with | 3076 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with |
| 3077 * exactly <i>n</i> type parameters. | 3077 * exactly <i>n</i> type parameters. |
| 3078 * | 3078 * |
| 3079 * @param typeName the name of the type being referenced (<i>G</i>) | 3079 * @param typeName the name of the type being referenced (<i>G</i>) |
| 3080 * @param parameterCount the number of type parameters that were declared | 3080 * @param parameterCount the number of type parameters that were declared |
| 3081 * @param argumentCount the number of type arguments provided | 3081 * @param argumentCount the number of type arguments provided |
| 3082 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS | 3082 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS |
| 3083 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS | 3083 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS |
| 3084 */ | 3084 */ |
| 3085 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat icTypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 24, "The type '%s' is d eclared with %d type parameters, but %d type arguments were given"); | 3085 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat icTypeWarningCode.con1("WRONG_NUMBER_OF_TYPE_ARGUMENTS", 24, "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given"); |
| 3086 | 3086 |
| 3087 static const List<StaticTypeWarningCode> values = const [ | 3087 static const List<StaticTypeWarningCode> values = const [ |
| 3088 EXPECTED_ONE_LIST_TYPE_ARGUMENTS, | 3088 EXPECTED_ONE_LIST_TYPE_ARGUMENTS, |
| 3089 EXPECTED_TWO_MAP_TYPE_ARGUMENTS, | 3089 EXPECTED_TWO_MAP_TYPE_ARGUMENTS, |
| 3090 INACCESSIBLE_SETTER, | 3090 INACCESSIBLE_SETTER, |
| 3091 INCONSISTENT_METHOD_INHERITANCE, | 3091 INCONSISTENT_METHOD_INHERITANCE, |
| 3092 INSTANCE_ACCESS_TO_STATIC_MEMBER, | 3092 INSTANCE_ACCESS_TO_STATIC_MEMBER, |
| 3093 INVALID_ASSIGNMENT, | 3093 INVALID_ASSIGNMENT, |
| 3094 INVOCATION_OF_NON_FUNCTION, | 3094 INVOCATION_OF_NON_FUNCTION, |
| 3095 INVOCATION_OF_NON_FUNCTION_EXPRESSION, | 3095 INVOCATION_OF_NON_FUNCTION_EXPRESSION, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3161 * * A static warning occurs. | 3161 * * A static warning occurs. |
| 3162 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet hodError</i> is | 3162 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet hodError</i> is |
| 3163 * raised. | 3163 * raised. |
| 3164 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. | 3164 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. |
| 3165 * </ol> | 3165 * </ol> |
| 3166 * | 3166 * |
| 3167 * @param ambiguousTypeName the name of the ambiguous type | 3167 * @param ambiguousTypeName the name of the ambiguous type |
| 3168 * @param firstLibraryName the name of the first library that the type is foun d | 3168 * @param firstLibraryName the name of the first library that the type is foun d |
| 3169 * @param secondLibraryName the name of the second library that the type is fo und | 3169 * @param secondLibraryName the name of the second library that the type is fo und |
| 3170 */ | 3170 */ |
| 3171 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode.con1 ('AMBIGUOUS_IMPORT', 0, "The name '%s' is defined in the libraries %s"); | 3171 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode.con1 ("AMBIGUOUS_IMPORT", 0, "The name '{0}' is defined in the libraries {1}"); |
| 3172 | 3172 |
| 3173 /** | 3173 /** |
| 3174 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 <= i <= n+ | 3174 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 <= i <= n+ |
| 3175 * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor | 3175 * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor |
| 3176 * <i>T.id</i> (respectively <i>T</i>). | 3176 * <i>T.id</i> (respectively <i>T</i>). |
| 3177 * | 3177 * |
| 3178 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub >, 1 <= i <= | 3178 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub >, 1 <= i <= |
| 3179 * n+ k</i> may not be assigned to the type of the corresponding formal parame ter of the | 3179 * n+ k</i> may not be assigned to the type of the corresponding formal parame ter of the |
| 3180 * constructor <i>T.id</i> (respectively <i>T</i>). | 3180 * constructor <i>T.id</i> (respectively <i>T</i>). |
| 3181 * | 3181 * |
| 3182 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 3182 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 3183 * <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 <= | 3183 * <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 <= |
| 3184 * 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>. | 3184 * 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>. |
| 3185 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 3185 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 3186 * j <= m</i>. | 3186 * j <= m</i>. |
| 3187 * | 3187 * |
| 3188 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 & lt;= i <= l</i>, | 3188 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 & lt;= i <= l</i>, |
| 3189 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, & hellip; | 3189 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, & hellip; |
| 3190 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if | 3190 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if |
| 3191 * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where < i>r = q<sub>j</sub>, | 3191 * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where < i>r = q<sub>j</sub>, |
| 3192 * 1 <= j <= l</i>. | 3192 * 1 <= j <= l</i>. |
| 3193 * | 3193 * |
| 3194 * @param actualType the name of the actual argument type | 3194 * @param actualType the name of the actual argument type |
| 3195 * @param expectedType the name of the expected type | 3195 * @param expectedType the name of the expected type |
| 3196 */ | 3196 */ |
| 3197 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarn ingCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot b e assigned to the parameter type '%s'"); | 3197 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarn ingCode.con1("ARGUMENT_TYPE_NOT_ASSIGNABLE", 1, "The argument type '{0}' cannot be assigned to the parameter type '{1}'"); |
| 3198 | 3198 |
| 3199 /** | 3199 /** |
| 3200 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError | 3200 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError |
| 3201 * to be thrown, because no setter is defined for it. The assignment will also give rise to a | 3201 * to be thrown, because no setter is defined for it. The assignment will also give rise to a |
| 3202 * static warning for the same reason. | 3202 * static warning for the same reason. |
| 3203 * | 3203 * |
| 3204 * A constant variable is always implicitly final. | 3204 * A constant variable is always implicitly final. |
| 3205 */ | 3205 */ |
| 3206 static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode.c on1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value"); | 3206 static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode.c on1("ASSIGNMENT_TO_CONST", 2, "Constant variables cannot be assigned a value"); |
| 3207 | 3207 |
| 3208 /** | 3208 /** |
| 3209 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError | 3209 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError |
| 3210 * to be thrown, because no setter is defined for it. The assignment will also give rise to a | 3210 * to be thrown, because no setter is defined for it. The assignment will also give rise to a |
| 3211 * static warning for the same reason. | 3211 * static warning for the same reason. |
| 3212 */ | 3212 */ |
| 3213 static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode.c on1('ASSIGNMENT_TO_FINAL', 3, "'%s' cannot be used as a setter, it is final"); | 3213 static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode.c on1("ASSIGNMENT_TO_FINAL", 3, "'{0}' cannot be used as a setter, it is final"); |
| 3214 | 3214 |
| 3215 /** | 3215 /** |
| 3216 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError | 3216 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError |
| 3217 * to be thrown, because no setter is defined for it. The assignment will also give rise to a | 3217 * to be thrown, because no setter is defined for it. The assignment will also give rise to a |
| 3218 * static warning for the same reason. | 3218 * static warning for the same reason. |
| 3219 */ | 3219 */ |
| 3220 static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWar ningCode.con1('ASSIGNMENT_TO_FINAL_NO_SETTER', 4, "No setter named '%s' in class '%s'"); | 3220 static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWar ningCode.con1("ASSIGNMENT_TO_FINAL_NO_SETTER", 4, "No setter named '{0}' in clas s '{1}'"); |
| 3221 | 3221 |
| 3222 /** | 3222 /** |
| 3223 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs | 3223 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs |
| 3224 * inside a top level or static function (be it function, method, getter, or s etter) or variable | 3224 * inside a top level or static function (be it function, method, getter, or s etter) or variable |
| 3225 * initializer and there is neither a local variable declaration with name <i> v</i> nor setter | 3225 * initializer and there is neither a local variable declaration with name <i> v</i> nor setter |
| 3226 * declaration with name <i>v=</i> in the lexical scope enclosing the assignme nt. | 3226 * declaration with name <i>v=</i> in the lexical scope enclosing the assignme nt. |
| 3227 */ | 3227 */ |
| 3228 static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCod e.con1('ASSIGNMENT_TO_FUNCTION', 5, "Functions cannot be assigned a value"); | 3228 static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCod e.con1("ASSIGNMENT_TO_FUNCTION", 5, "Functions cannot be assigned a value"); |
| 3229 | 3229 |
| 3230 /** | 3230 /** |
| 3231 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type | 3231 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type |
| 3232 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. | 3232 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. |
| 3233 */ | 3233 */ |
| 3234 static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode. con1('ASSIGNMENT_TO_METHOD', 6, "Methods cannot be assigned a value"); | 3234 static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode. con1("ASSIGNMENT_TO_METHOD", 6, "Methods cannot be assigned a value"); |
| 3235 | 3235 |
| 3236 /** | 3236 /** |
| 3237 * 13.9 Switch: It is a static warning if the last statement of the statement sequence | 3237 * 13.9 Switch: It is a static warning if the last statement of the statement sequence |
| 3238 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. | 3238 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. |
| 3239 */ | 3239 */ |
| 3240 static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarning Code.con1('CASE_BLOCK_NOT_TERMINATED', 7, "The last statement of the 'case' shou ld be 'break', 'continue', 'return' or 'throw'"); | 3240 static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarning Code.con1("CASE_BLOCK_NOT_TERMINATED", 7, "The last statement of the 'case' shou ld be 'break', 'continue', 'return' or 'throw'"); |
| 3241 | 3241 |
| 3242 /** | 3242 /** |
| 3243 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the | 3243 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the |
| 3244 * current lexical scope. | 3244 * current lexical scope. |
| 3245 */ | 3245 */ |
| 3246 static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode.con1 ('CAST_TO_NON_TYPE', 8, "The name '%s' is not a type and cannot be used in an 'a s' expression"); | 3246 static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode.con1 ("CAST_TO_NON_TYPE", 8, "The name '{0}' is not a type and cannot be used in an ' as' expression"); |
| 3247 | 3247 |
| 3248 /** | 3248 /** |
| 3249 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or | 3249 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or |
| 3250 * inherited in a concrete class. | 3250 * inherited in a concrete class. |
| 3251 */ | 3251 */ |
| 3252 static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const Sta ticWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 9, "'%s' must have a method body because '%s' is not abstract"); | 3252 static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const Sta ticWarningCode.con1("CONCRETE_CLASS_WITH_ABSTRACT_MEMBER", 9, "'{0}' must have a method body because '{1}' is not abstract"); |
| 3253 | 3253 |
| 3254 /** | 3254 /** |
| 3255 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> would be | 3255 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> would be |
| 3256 * introduced into the top level scope of <i>L</i> by an import from a library whose URI begins | 3256 * introduced into the top level scope of <i>L</i> by an import from a library whose URI begins |
| 3257 * with <i>dart:</i> and an import from a library whose URI does not begin wit h <i>dart:</i>: | 3257 * with <i>dart:</i> and an import from a library whose URI does not begin wit h <i>dart:</i>: |
| 3258 * * The import from <i>dart:</i> is implicitly extended by a hide N clause. | 3258 * * The import from <i>dart:</i> is implicitly extended by a hide N clause. |
| 3259 * * A static warning is issued. | 3259 * * A static warning is issued. |
| 3260 * | 3260 * |
| 3261 * @param ambiguousName the ambiguous name | 3261 * @param ambiguousName the ambiguous name |
| 3262 * @param sdkLibraryName the name of the dart: library that the element is fou nd | 3262 * @param sdkLibraryName the name of the dart: library that the element is fou nd |
| 3263 * @param otherLibraryName the name of the non-dart: library that the element is found | 3263 * @param otherLibraryName the name of the non-dart: library that the element is found |
| 3264 */ | 3264 */ |
| 3265 static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCo de.con1('CONFLICTING_DART_IMPORT', 10, "Element '%s' from SDK library '%s' is im plicitly hidden by '%s'"); | 3265 static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCo de.con1("CONFLICTING_DART_IMPORT", 10, "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'"); |
| 3266 | 3266 |
| 3267 /** | 3267 /** |
| 3268 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc e getter named | 3268 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc e getter named |
| 3269 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec lared in a | 3269 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec lared in a |
| 3270 * superclass of <i>C</i>. | 3270 * superclass of <i>C</i>. |
| 3271 * | 3271 * |
| 3272 * @param superName the name of the super class declaring a static member | 3272 * @param superName the name of the super class declaring a static member |
| 3273 */ | 3273 */ |
| 3274 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_ME MBER', 11, "Superclass '%s' declares static member with the same name"); | 3274 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1("CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_ME MBER", 11, "Superclass '{0}' declares static member with the same name"); |
| 3275 | 3275 |
| 3276 /** | 3276 /** |
| 3277 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method | 3277 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method |
| 3278 * named <i>n</i> and has a setter named <i>n=</i>. | 3278 * named <i>n</i> and has a setter named <i>n=</i>. |
| 3279 */ | 3279 */ |
| 3280 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const Stat icWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 12, "Class '%s' declare s instance method '%s', but also has a setter with the same name from '%s'"); | 3280 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const Stat icWarningCode.con1("CONFLICTING_INSTANCE_METHOD_SETTER", 12, "Class '{0}' declar es instance method '{1}', but also has a setter with the same name from '{2}'"); |
| 3281 | 3281 |
| 3282 /** | 3282 /** |
| 3283 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method | 3283 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method |
| 3284 * named <i>n</i> and has a setter named <i>n=</i>. | 3284 * named <i>n</i> and has a setter named <i>n=</i>. |
| 3285 */ | 3285 */ |
| 3286 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const Sta ticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 13, "Class '%s' decla res the setter '%s', but also has an instance method in the same class"); | 3286 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const Sta ticWarningCode.con1("CONFLICTING_INSTANCE_METHOD_SETTER2", 13, "Class '{0}' decl ares the setter '{1}', but also has an instance method in the same class"); |
| 3287 | 3287 |
| 3288 /** | 3288 /** |
| 3289 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc e setter named | 3289 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc e setter named |
| 3290 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de clared in a | 3290 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de clared in a |
| 3291 * superclass of <i>C</i>. | 3291 * superclass of <i>C</i>. |
| 3292 * | 3292 * |
| 3293 * @param superName the name of the super class declaring a static member | 3293 * @param superName the name of the super class declaring a static member |
| 3294 */ | 3294 */ |
| 3295 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_ME MBER', 14, "Superclass '%s' declares static member with the same name"); | 3295 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1("CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_ME MBER", 14, "Superclass '{0}' declares static member with the same name"); |
| 3296 | 3296 |
| 3297 /** | 3297 /** |
| 3298 * 7.2 Getters: It is a static warning if a class declares a static getter nam ed <i>v</i> and also | 3298 * 7.2 Getters: It is a static warning if a class declares a static getter nam ed <i>v</i> and also |
| 3299 * has a non-static setter named <i>v=</i>. | 3299 * has a non-static setter named <i>v=</i>. |
| 3300 */ | 3300 */ |
| 3301 static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 1 5, "Class '%s' declares non-static setter with the same name"); | 3301 static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode.con1("CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER", 1 5, "Class '{0}' declares non-static setter with the same name"); |
| 3302 | 3302 |
| 3303 /** | 3303 /** |
| 3304 * 7.3 Setters: It is a static warning if a class declares a static setter nam ed <i>v=</i> and | 3304 * 7.3 Setters: It is a static warning if a class declares a static setter nam ed <i>v=</i> and |
| 3305 * also has a non-static member named <i>v</i>. | 3305 * also has a non-static member named <i>v</i>. |
| 3306 */ | 3306 */ |
| 3307 static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 1 6, "Class '%s' declares non-static member with the same name"); | 3307 static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode.con1("CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER", 1 6, "Class '{0}' declares non-static member with the same name"); |
| 3308 | 3308 |
| 3309 /** | 3309 /** |
| 3310 * 12.11.2 Const: Given an instance creation expression of the form <i>const q (a<sub>1</sub>, | 3310 * 12.11.2 Const: Given an instance creation expression of the form <i>const q (a<sub>1</sub>, |
| 3311 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const ructor of an | 3311 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const ructor of an |
| 3312 * abstract class but <i>q</i> is not a factory constructor. | 3312 * abstract class but <i>q</i> is not a factory constructor. |
| 3313 */ | 3313 */ |
| 3314 static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarning Code.con1('CONST_WITH_ABSTRACT_CLASS', 17, "Abstract classes cannot be created w ith a 'const' expression"); | 3314 static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarning Code.con1("CONST_WITH_ABSTRACT_CLASS", 17, "Abstract classes cannot be created w ith a 'const' expression"); |
| 3315 | 3315 |
| 3316 /** | 3316 /** |
| 3317 * 12.7 Maps: It is a static warning if the values of any two keys in a map li teral are equal. | 3317 * 12.7 Maps: It is a static warning if the values of any two keys in a map li teral are equal. |
| 3318 */ | 3318 */ |
| 3319 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode.con 1('EQUAL_KEYS_IN_MAP', 18, "Keys in a map cannot be equal"); | 3319 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode.con 1("EQUAL_KEYS_IN_MAP", 18, "Keys in a map cannot be equal"); |
| 3320 | 3320 |
| 3321 /** | 3321 /** |
| 3322 * 14.2 Exports: It is a static warning to export two different libraries with the same name. | 3322 * 14.2 Exports: It is a static warning to export two different libraries with the same name. |
| 3323 * | 3323 * |
| 3324 * @param uri1 the uri pointing to a first library | 3324 * @param uri1 the uri pointing to a first library |
| 3325 * @param uri2 the uri pointing to a second library | 3325 * @param uri2 the uri pointing to a second library |
| 3326 * @param name the shared name of the exported libraries | 3326 * @param name the shared name of the exported libraries |
| 3327 */ | 3327 */ |
| 3328 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 19, "The exported libraries '%s ' and '%s' should not have the same name '%s'"); | 3328 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1("EXPORT_DUPLICATED_LIBRARY_NAME", 19, "The exported libraries '{0 }' and '{1}' should not have the same name '{2}'"); |
| 3329 | 3329 |
| 3330 /** | 3330 /** |
| 3331 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</ i> or if <i>m > | 3331 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</ i> or if <i>m > |
| 3332 * n</i>. | 3332 * n</i>. |
| 3333 * | 3333 * |
| 3334 * @param requiredCount the maximum number of positional arguments | 3334 * @param requiredCount the maximum number of positional arguments |
| 3335 * @param argumentCount the actual number of positional arguments given | 3335 * @param argumentCount the actual number of positional arguments given |
| 3336 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS | 3336 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS |
| 3337 */ | 3337 */ |
| 3338 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin gCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 20, "%d positional arguments expected, but %d found"); | 3338 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin gCode.con1("EXTRA_POSITIONAL_ARGUMENTS", 20, "{0} positional arguments expected, but {1} found"); |
| 3339 | 3339 |
| 3340 /** | 3340 /** |
| 3341 * 5. Variables: It is a static warning if a final instance variable that has been initialized at | 3341 * 5. Variables: It is a static warning if a final instance variable that has been initialized at |
| 3342 * its point of declaration is also initialized in a constructor. | 3342 * its point of declaration is also initialized in a constructor. |
| 3343 */ | 3343 */ |
| 3344 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = const StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATI ON', 21, "Values cannot be set in the constructor if they are final, and have al ready been set"); | 3344 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = const StaticWarningCode.con1("FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATI ON", 21, "Values cannot be set in the constructor if they are final, and have al ready been set"); |
| 3345 | 3345 |
| 3346 /** | 3346 /** |
| 3347 * 5. Variables: It is a static warning if a final instance variable that has been initialized at | 3347 * 5. Variables: It is a static warning if a final instance variable that has been initialized at |
| 3348 * its point of declaration is also initialized in a constructor. | 3348 * its point of declaration is also initialized in a constructor. |
| 3349 * | 3349 * |
| 3350 * @param name the name of the field in question | 3350 * @param name the name of the field in question |
| 3351 */ | 3351 */ |
| 3352 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = const StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCT OR', 22, "'%s' is final and was given a value when it was declared, so it cannot be set to a new value"); | 3352 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = const StaticWarningCode.con1("FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCT OR", 22, "'{0}' is final and was given a value when it was declared, so it canno t be set to a new value"); |
| 3353 | 3353 |
| 3354 /** | 3354 /** |
| 3355 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t his</b>.<i>v</i> = | 3355 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t his</b>.<i>v</i> = |
| 3356 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t o an object | 3356 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t o an object |
| 3357 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi s is bound to | 3357 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi s is bound to |
| 3358 * <i>o</i>. | 3358 * <i>o</i>. |
| 3359 * | 3359 * |
| 3360 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 3360 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 3361 * <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 <= | 3361 * <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 <= |
| 3362 * 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>. | 3362 * 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>. |
| 3363 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 3363 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 3364 * j <= m</i>. | 3364 * j <= m</i>. |
| 3365 * | 3365 * |
| 3366 * @param initializerType the name of the type of the initializer expression | 3366 * @param initializerType the name of the type of the initializer expression |
| 3367 * @param fieldType the name of the type of the field | 3367 * @param fieldType the name of the type of the field |
| 3368 */ | 3368 */ |
| 3369 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const Static WarningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 23, "The initializer type ' %s' cannot be assigned to the field type '%s'"); | 3369 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const Static WarningCode.con1("FIELD_INITIALIZER_NOT_ASSIGNABLE", 23, "The initializer type ' {0}' cannot be assigned to the field type '{1}'"); |
| 3370 | 3370 |
| 3371 /** | 3371 /** |
| 3372 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a | 3372 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a |
| 3373 * static warning if the static type of <i>id</i> is not assignable to <i>T<su b>id</sub></i>. | 3373 * static warning if the static type of <i>id</i> is not assignable to <i>T<su b>id</sub></i>. |
| 3374 * | 3374 * |
| 3375 * @param parameterType the name of the type of the field formal parameter | 3375 * @param parameterType the name of the type of the field formal parameter |
| 3376 * @param fieldType the name of the type of the field | 3376 * @param fieldType the name of the type of the field |
| 3377 */ | 3377 */ |
| 3378 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = cons t StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 24, "The pa rameter type '%s' is incompatable with the field type '%s'"); | 3378 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = cons t StaticWarningCode.con1("FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE", 24, "The pa rameter type '{0}' is incompatable with the field type '{1}'"); |
| 3379 | 3379 |
| 3380 /** | 3380 /** |
| 3381 * 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final | 3381 * 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final |
| 3382 * and <i>v</i> is not initialized at its point of declaration. | 3382 * and <i>v</i> is not initialized at its point of declaration. |
| 3383 * | 3383 * |
| 3384 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar ed in the | 3384 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar ed in the |
| 3385 * immediately enclosing class must have an initializer in <i>k</i>'s initiali zer list unless it | 3385 * immediately enclosing class must have an initializer in <i>k</i>'s initiali zer list unless it |
| 3386 * has already been initialized by one of the following means: | 3386 * has already been initialized by one of the following means: |
| 3387 * * Initialization at the declaration of <i>f</i>. | 3387 * * Initialization at the declaration of <i>f</i>. |
| 3388 * * Initialization by means of an initializing formal of <i>k</i>. | 3388 * * Initialization by means of an initializing formal of <i>k</i>. |
| 3389 * or a static warning occurs. | 3389 * or a static warning occurs. |
| 3390 * | 3390 * |
| 3391 * @param name the name of the uninitialized final variable | 3391 * @param name the name of the uninitialized final variable |
| 3392 */ | 3392 */ |
| 3393 static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode .con1('FINAL_NOT_INITIALIZED', 25, "The final variable '%s' must be initialized" ); | 3393 static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode .con1("FINAL_NOT_INITIALIZED", 25, "The final variable '{0}' must be initialized "); |
| 3394 | 3394 |
| 3395 /** | 3395 /** |
| 3396 * 15.5 Function Types: It is a static warning if a concrete class implements Function and does | 3396 * 15.5 Function Types: It is a static warning if a concrete class implements Function and does |
| 3397 * not have a concrete method named call(). | 3397 * not have a concrete method named call(). |
| 3398 */ | 3398 */ |
| 3399 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode .con1('FUNCTION_WITHOUT_CALL', 26, "Concrete classes that implement Function mus t implement the method call()"); | 3399 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode .con1("FUNCTION_WITHOUT_CALL", 26, "Concrete classes that implement Function mus t implement the method call()"); |
| 3400 | 3400 |
| 3401 /** | 3401 /** |
| 3402 * 14.1 Imports: It is a static warning to import two different libraries with the same name. | 3402 * 14.1 Imports: It is a static warning to import two different libraries with the same name. |
| 3403 * | 3403 * |
| 3404 * @param uri1 the uri pointing to a first library | 3404 * @param uri1 the uri pointing to a first library |
| 3405 * @param uri2 the uri pointing to a second library | 3405 * @param uri2 the uri pointing to a second library |
| 3406 * @param name the shared name of the imported libraries | 3406 * @param name the shared name of the imported libraries |
| 3407 */ | 3407 */ |
| 3408 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 27, "The imported libraries '%s ' and '%s' should not have the same name '%s'"); | 3408 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1("IMPORT_DUPLICATED_LIBRARY_NAME", 27, "The imported libraries '{0 }' and '{1}' should not have the same name '{2}'"); |
| 3409 | 3409 |
| 3410 /** | 3410 /** |
| 3411 * 14.1 Imports: It is a static warning if the specified URI of a deferred imp ort does not refer | 3411 * 14.1 Imports: It is a static warning if the specified URI of a deferred imp ort does not refer |
| 3412 * to a library declaration. | 3412 * to a library declaration. |
| 3413 * | 3413 * |
| 3414 * @param uri the uri pointing to a non-library declaration | 3414 * @param uri the uri pointing to a non-library declaration |
| 3415 * @see CompileTimeErrorCode#IMPORT_OF_NON_LIBRARY | 3415 * @see CompileTimeErrorCode#IMPORT_OF_NON_LIBRARY |
| 3416 */ | 3416 */ |
| 3417 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode .con1('IMPORT_OF_NON_LIBRARY', 28, "The imported library '%s' must not have a pa rt-of directive"); | 3417 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode .con1("IMPORT_OF_NON_LIBRARY", 28, "The imported library '{0}' must not have a p art-of directive"); |
| 3418 | 3418 |
| 3419 /** | 3419 /** |
| 3420 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause m ultiple members | 3420 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause m ultiple members |
| 3421 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the same name <i>n</i> t hat would be | 3421 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the same name <i>n</i> t hat would be |
| 3422 * inherited (because identically named members existed in several superinterf aces) then at most | 3422 * inherited (because identically named members existed in several superinterf aces) then at most |
| 3423 * one member is inherited. | 3423 * one member is inherited. |
| 3424 * | 3424 * |
| 3425 * If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i> are gett ers none of the | 3425 * If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i> are gett ers none of the |
| 3426 * <i>m<sub>i</sub></i> are inherited, and a static warning is issued. | 3426 * <i>m<sub>i</sub></i> are inherited, and a static warning is issued. |
| 3427 */ | 3427 */ |
| 3428 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = const StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_ME THOD', 29, "'%s' is inherited as a getter and also a method"); | 3428 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = const StaticWarningCode.con1("INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_ME THOD", 29, "'{0}' is inherited as a getter and also a method"); |
| 3429 | 3429 |
| 3430 /** | 3430 /** |
| 3431 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method | 3431 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method |
| 3432 * named <i>n</i> and an accessible static member named <i>n</i> is declared i n a superclass of | 3432 * named <i>n</i> and an accessible static member named <i>n</i> is declared i n a superclass of |
| 3433 * <i>C</i>. | 3433 * <i>C</i>. |
| 3434 * | 3434 * |
| 3435 * @param memberName the name of the member with the name conflict | 3435 * @param memberName the name of the member with the name conflict |
| 3436 * @param superclassName the name of the enclosing class that has the static m ember | 3436 * @param superclassName the name of the enclosing class that has the static m ember |
| 3437 */ | 3437 */ |
| 3438 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = const StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCL ASS_STATIC', 30, "'%s' collides with a static member in the superclass '%s'"); | 3438 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = const StaticWarningCode.con1("INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCL ASS_STATIC", 30, "'{0}' collides with a static member in the superclass '{1}'"); |
| 3439 | 3439 |
| 3440 /** | 3440 /** |
| 3441 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette r <i>m2</i> and the | 3441 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette r <i>m2</i> and the |
| 3442 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 3442 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 3443 * | 3443 * |
| 3444 * @param actualReturnTypeName the name of the expected return type | 3444 * @param actualReturnTypeName the name of the expected return type |
| 3445 * @param expectedReturnType the name of the actual return type, not assignabl e to the | 3445 * @param expectedReturnType the name of the actual return type, not assignabl e to the |
| 3446 * actualReturnTypeName | 3446 * actualReturnTypeName |
| 3447 * @param className the name of the class where the overridden getter is decla red | 3447 * @param className the name of the class where the overridden getter is decla red |
| 3448 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE | 3448 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE |
| 3449 */ | 3449 */ |
| 3450 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 31, "The return type '%s' is not assignable to '%s' as required by the getter it is overriding from ' %s'"); | 3450 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1("INVALID_GETTER_OVERRIDE_RETURN_TYPE", 31, "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'"); |
| 3451 | 3451 |
| 3452 /** | 3452 /** |
| 3453 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3453 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3454 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 3454 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 3455 * | 3455 * |
| 3456 * @param actualParamTypeName the name of the expected parameter type | 3456 * @param actualParamTypeName the name of the expected parameter type |
| 3457 * @param expectedParamType the name of the actual parameter type, not assigna ble to the | 3457 * @param expectedParamType the name of the actual parameter type, not assigna ble to the |
| 3458 * actualParamTypeName | 3458 * actualParamTypeName |
| 3459 * @param className the name of the class where the overridden method is decla red | 3459 * @param className the name of the class where the overridden method is decla red |
| 3460 */ | 3460 */ |
| 3461 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons t StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 32, "The pa rameter type '%s' is not assignable to '%s' as required by the method it is over riding from '%s'"); | 3461 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons t StaticWarningCode.con1("INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE", 32, "The pa rameter type '{0}' is not assignable to '{1}' as required by the method it is ov erriding from '{2}'"); |
| 3462 | 3462 |
| 3463 /** | 3463 /** |
| 3464 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3464 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3465 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 3465 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 3466 * | 3466 * |
| 3467 * @param actualParamTypeName the name of the expected parameter type | 3467 * @param actualParamTypeName the name of the expected parameter type |
| 3468 * @param expectedParamType the name of the actual parameter type, not assigna ble to the | 3468 * @param expectedParamType the name of the actual parameter type, not assigna ble to the |
| 3469 * actualParamTypeName | 3469 * actualParamTypeName |
| 3470 * @param className the name of the class where the overridden method is decla red | 3470 * @param className the name of the class where the overridden method is decla red |
| 3471 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE | 3471 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE |
| 3472 */ | 3472 */ |
| 3473 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 33, "The parameter type '%s' is not assignable to '%s' as required by the method it is ov erriding from '%s'"); | 3473 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1("INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE", 33, "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'"); |
| 3474 | 3474 |
| 3475 /** | 3475 /** |
| 3476 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3476 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3477 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 3477 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 3478 * | 3478 * |
| 3479 * @param actualParamTypeName the name of the expected parameter type | 3479 * @param actualParamTypeName the name of the expected parameter type |
| 3480 * @param expectedParamType the name of the actual parameter type, not assigna ble to the | 3480 * @param expectedParamType the name of the actual parameter type, not assigna ble to the |
| 3481 * actualParamTypeName | 3481 * actualParamTypeName |
| 3482 * @param className the name of the class where the overridden method is decla red | 3482 * @param className the name of the class where the overridden method is decla red |
| 3483 */ | 3483 */ |
| 3484 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c onst StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 34, " The parameter type '%s' is not assignable to '%s' as required by the method it i s overriding from '%s'"); | 3484 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c onst StaticWarningCode.con1("INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE", 34, " The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'"); |
| 3485 | 3485 |
| 3486 /** | 3486 /** |
| 3487 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3487 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3488 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 3488 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 3489 * | 3489 * |
| 3490 * @param actualReturnTypeName the name of the expected return type | 3490 * @param actualReturnTypeName the name of the expected return type |
| 3491 * @param expectedReturnType the name of the actual return type, not assignabl e to the | 3491 * @param expectedReturnType the name of the actual return type, not assignabl e to the |
| 3492 * actualReturnTypeName | 3492 * actualReturnTypeName |
| 3493 * @param className the name of the class where the overridden method is decla red | 3493 * @param className the name of the class where the overridden method is decla red |
| 3494 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE | 3494 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE |
| 3495 */ | 3495 */ |
| 3496 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 35, "The return type '%s' is not assignable to '%s' as required by the method it is overriding from ' %s'"); | 3496 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1("INVALID_METHOD_OVERRIDE_RETURN_TYPE", 35, "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'"); |
| 3497 | 3497 |
| 3498 /** | 3498 /** |
| 3499 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3499 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3500 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for | 3500 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for |
| 3501 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value | 3501 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value |
| 3502 * for <i>p</i>. | 3502 * for <i>p</i>. |
| 3503 */ | 3503 */ |
| 3504 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED ', 36, "Parameters cannot override default values, this method overrides '%s.%s' where '%s' has a different value"); | 3504 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode.con1("INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED ", 36, "Parameters cannot override default values, this method overrides '{0}.{1 }' where '{2}' has a different value"); |
| 3505 | 3505 |
| 3506 /** | 3506 /** |
| 3507 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3507 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3508 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for | 3508 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for |
| 3509 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value | 3509 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value |
| 3510 * for <i>p</i>. | 3510 * for <i>p</i>. |
| 3511 */ | 3511 */ |
| 3512 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_ POSITIONAL', 37, "Parameters cannot override default values, this method overrid es '%s.%s' where this positional parameter has a different value"); | 3512 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = const StaticWarningCode.con1("INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_ POSITIONAL", 37, "Parameters cannot override default values, this method overrid es '{0}.{1}' where this positional parameter has a different value"); |
| 3513 | 3513 |
| 3514 /** | 3514 /** |
| 3515 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3515 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3516 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para meters declared by | 3516 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para meters declared by |
| 3517 * <i>m2</i>. | 3517 * <i>m2</i>. |
| 3518 * | 3518 * |
| 3519 * @param paramCount the number of named parameters in the overridden member | 3519 * @param paramCount the number of named parameters in the overridden member |
| 3520 * @param className the name of the class from the overridden method | 3520 * @param className the name of the class from the overridden method |
| 3521 */ | 3521 */ |
| 3522 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e.con1('INVALID_OVERRIDE_NAMED', 38, "Missing the named parameter '%s' to match the overridden method from '%s'"); | 3522 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e.con1("INVALID_OVERRIDE_NAMED", 38, "Missing the named parameter '{0}' to match the overridden method from '{1}'"); |
| 3523 | 3523 |
| 3524 /** | 3524 /** |
| 3525 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3525 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3526 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha n <i>m2</i>. | 3526 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha n <i>m2</i>. |
| 3527 * | 3527 * |
| 3528 * @param paramCount the number of positional parameters in the overridden mem ber | 3528 * @param paramCount the number of positional parameters in the overridden mem ber |
| 3529 * @param className the name of the class from the overridden method | 3529 * @param className the name of the class from the overridden method |
| 3530 */ | 3530 */ |
| 3531 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarni ngCode.con1('INVALID_OVERRIDE_POSITIONAL', 39, "Must have at least %d parameters to match the overridden method from '%s'"); | 3531 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarni ngCode.con1("INVALID_OVERRIDE_POSITIONAL", 39, "Must have at least {0} parameter s to match the overridden method from '{1}'"); |
| 3532 | 3532 |
| 3533 /** | 3533 /** |
| 3534 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an | 3534 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an |
| 3535 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa rameters than | 3535 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa rameters than |
| 3536 * <i>m2</i>. | 3536 * <i>m2</i>. |
| 3537 * | 3537 * |
| 3538 * @param paramCount the number of required parameters in the overridden membe r | 3538 * @param paramCount the number of required parameters in the overridden membe r |
| 3539 * @param className the name of the class from the overridden method | 3539 * @param className the name of the class from the overridden method |
| 3540 */ | 3540 */ |
| 3541 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarning Code.con1('INVALID_OVERRIDE_REQUIRED', 40, "Must have %d required parameters or less to match the overridden method from '%s'"); | 3541 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarning Code.con1("INVALID_OVERRIDE_REQUIRED", 40, "Must have {0} required parameters or less to match the overridden method from '{1}'"); |
| 3542 | 3542 |
| 3543 /** | 3543 /** |
| 3544 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette r <i>m2</i> and the | 3544 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette r <i>m2</i> and the |
| 3545 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 3545 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
| 3546 * | 3546 * |
| 3547 * @param actualParamTypeName the name of the expected parameter type | 3547 * @param actualParamTypeName the name of the expected parameter type |
| 3548 * @param expectedParamType the name of the actual parameter type, not assigna ble to the | 3548 * @param expectedParamType the name of the actual parameter type, not assigna ble to the |
| 3549 * actualParamTypeName | 3549 * actualParamTypeName |
| 3550 * @param className the name of the class where the overridden setter is decla red | 3550 * @param className the name of the class where the overridden setter is decla red |
| 3551 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE | 3551 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE |
| 3552 */ | 3552 */ |
| 3553 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 41, "The parameter type '%s' is not assignable to '%s' as required by the setter it is ov erriding from '%s'"); | 3553 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1("INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE", 41, "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'"); |
| 3554 | 3554 |
| 3555 /** | 3555 /** |
| 3556 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i> … | 3556 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i> … |
| 3557 * <i>e<sub>n</sub></i>] is evaluated as follows: | 3557 * <i>e<sub>n</sub></i>] is evaluated as follows: |
| 3558 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument | 3558 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument |
| 3559 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> | 3559 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> |
| 3560 * | 3560 * |
| 3561 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 3561 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 3562 * <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 <= | 3562 * <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 <= |
| 3563 * 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>. | 3563 * 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>. |
| 3564 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 3564 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 3565 * j <= m</i>. | 3565 * j <= m</i>. |
| 3566 */ | 3566 */ |
| 3567 static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Static WarningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 42, "The element type '%s' cannot be assigned to the list type '%s'"); | 3567 static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Static WarningCode.con1("LIST_ELEMENT_TYPE_NOT_ASSIGNABLE", 42, "The element type '{0}' cannot be assigned to the list type '{1}'"); |
| 3568 | 3568 |
| 3569 /** | 3569 /** |
| 3570 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : | 3570 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : |
| 3571 * <i>e<sub>1</sub></i> … <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as | 3571 * <i>e<sub>1</sub></i> … <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as |
| 3572 * follows: | 3572 * follows: |
| 3573 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second | 3573 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second |
| 3574 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 3574 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
| 3575 * | 3575 * |
| 3576 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 3576 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 3577 * <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 <= | 3577 * <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 <= |
| 3578 * 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>. | 3578 * 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>. |
| 3579 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 3579 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 3580 * j <= m</i>. | 3580 * j <= m</i>. |
| 3581 */ | 3581 */ |
| 3582 static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarni ngCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 43, "The element type '%s' cannot be assigned to the map key type '%s'"); | 3582 static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarni ngCode.con1("MAP_KEY_TYPE_NOT_ASSIGNABLE", 43, "The element type '{0}' cannot be assigned to the map key type '{1}'"); |
| 3583 | 3583 |
| 3584 /** | 3584 /** |
| 3585 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : | 3585 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su b></i> : |
| 3586 * <i>e<sub>1</sub></i> … <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as | 3586 * <i>e<sub>1</sub></i> … <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as |
| 3587 * follows: | 3587 * follows: |
| 3588 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second | 3588 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second |
| 3589 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 3589 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
| 3590 * | 3590 * |
| 3591 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of | 3591 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of |
| 3592 * <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 <= | 3592 * <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 <= |
| 3593 * 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>. | 3593 * 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>. |
| 3594 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= | 3594 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 <= |
| 3595 * j <= m</i>. | 3595 * j <= m</i>. |
| 3596 */ | 3596 */ |
| 3597 static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWar ningCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 44, "The element type '%s' cannot be assigned to the map value type '%s'"); | 3597 static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWar ningCode.con1("MAP_VALUE_TYPE_NOT_ASSIGNABLE", 44, "The element type '{0}' canno t be assigned to the map value type '{1}'"); |
| 3598 | 3598 |
| 3599 /** | 3599 /** |
| 3600 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type | 3600 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type |
| 3601 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be | 3601 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be |
| 3602 * assigned to <i>S</i>. | 3602 * assigned to <i>S</i>. |
| 3603 */ | 3603 */ |
| 3604 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const Stat icWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 45, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s')"); | 3604 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const Stat icWarningCode.con1("MISMATCHED_GETTER_AND_SETTER_TYPES", 45, "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}') "); |
| 3605 | 3605 |
| 3606 /** | 3606 /** |
| 3607 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type | 3607 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type |
| 3608 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be | 3608 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be |
| 3609 * assigned to <i>S</i>. | 3609 * assigned to <i>S</i>. |
| 3610 */ | 3610 */ |
| 3611 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPER TYPE', 46, "The parameter type for setter '%s' is '%s' which is not assignable t o its getter (of type '%s'), from superclass '%s'"); | 3611 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE = const StaticWarningCode.con1("MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPER TYPE", 46, "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'"); |
| 3612 | 3612 |
| 3613 /** | 3613 /** |
| 3614 * 13.12 Return: It is a static warning if a function contains both one or mor e return statements | 3614 * 13.12 Return: It is a static warning if a function contains both one or mor e return statements |
| 3615 * of the form <i>return;</i> and one or more return statements of the form <i >return e;</i>. | 3615 * of the form <i>return;</i> and one or more return statements of the form <i >return e;</i>. |
| 3616 */ | 3616 */ |
| 3617 static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode.co n1('MIXED_RETURN_TYPES', 47, "Methods and functions cannot use return both with and without values"); | 3617 static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode.co n1("MIXED_RETURN_TYPES", 47, "Methods and functions cannot use return both with and without values"); |
| 3618 | 3618 |
| 3619 /** | 3619 /** |
| 3620 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst ract class and | 3620 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst ract class and |
| 3621 * <i>q</i> is not a factory constructor. | 3621 * <i>q</i> is not a factory constructor. |
| 3622 */ | 3622 */ |
| 3623 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo de.con1('NEW_WITH_ABSTRACT_CLASS', 48, "Abstract classes cannot be created with a 'new' expression"); | 3623 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo de.con1("NEW_WITH_ABSTRACT_CLASS", 48, "Abstract classes cannot be created with a 'new' expression"); |
| 3624 | 3624 |
| 3625 /** | 3625 /** |
| 3626 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat ic warning. | 3626 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat ic warning. |
| 3627 * | 3627 * |
| 3628 * @param typeName the name of the type being referenced (<i>S</i>) | 3628 * @param typeName the name of the type being referenced (<i>S</i>) |
| 3629 * @param parameterCount the number of type parameters that were declared | 3629 * @param parameterCount the number of type parameters that were declared |
| 3630 * @param argumentCount the number of type arguments provided | 3630 * @param argumentCount the number of type arguments provided |
| 3631 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS | 3631 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS |
| 3632 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS | 3632 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS |
| 3633 */ | 3633 */ |
| 3634 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static WarningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 49, "The type '%s' is decla red with %d type parameters, but %d type arguments were given"); | 3634 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static WarningCode.con1("NEW_WITH_INVALID_TYPE_PARAMETERS", 49, "The type '{0}' is decl ared with {1} type parameters, but {2} type arguments were given"); |
| 3635 | 3635 |
| 3636 /** | 3636 /** |
| 3637 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i n the current scope, | 3637 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i n the current scope, |
| 3638 * optionally followed by type arguments. | 3638 * optionally followed by type arguments. |
| 3639 * | 3639 * |
| 3640 * @param name the name of the non-type element | 3640 * @param name the name of the non-type element |
| 3641 */ | 3641 */ |
| 3642 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode.con 1('NEW_WITH_NON_TYPE', 50, "The name '%s' is not a class"); | 3642 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode.con 1("NEW_WITH_NON_TYPE", 50, "The name '{0}' is not a class"); |
| 3643 | 3643 |
| 3644 /** | 3644 /** |
| 3645 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: | 3645 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: |
| 3646 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n< /sub>, | 3646 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n< /sub>, |
| 3647 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a | 3647 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a |
| 3648 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. | 3648 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. |
| 3649 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x< sub>n+1</sub>: | 3649 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x< sub>n+1</sub>: |
| 3650 * a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a st atic warning if the | 3650 * a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a st atic warning if the |
| 3651 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. | 3651 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. |
| 3652 */ | 3652 */ |
| 3653 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWa rningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 51, "The class '%s' does not ha ve a constructor '%s'"); | 3653 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWa rningCode.con1("NEW_WITH_UNDEFINED_CONSTRUCTOR", 51, "The class '{0}' does not h ave a constructor '{1}'"); |
| 3654 | 3654 |
| 3655 /** | 3655 /** |
| 3656 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: | 3656 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: |
| 3657 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n< /sub>, | 3657 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n< /sub>, |
| 3658 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a | 3658 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a |
| 3659 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. | 3659 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. |
| 3660 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x< sub>n+1</sub>: | 3660 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x< sub>n+1</sub>: |
| 3661 * a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a st atic warning if the | 3661 * a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a st atic warning if the |
| 3662 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. | 3662 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. |
| 3663 */ | 3663 */ |
| 3664 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 52, "The class '%s' does not have a default constructor"); | 3664 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode.con1("NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT", 52, "The class '{0}' does not have a default constructor"); |
| 3665 | 3665 |
| 3666 /** | 3666 /** |
| 3667 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an | 3667 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an |
| 3668 * abstract method. | 3668 * abstract method. |
| 3669 * | 3669 * |
| 3670 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own | 3670 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own |
| 3671 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> | 3671 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> |
| 3672 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit | 3672 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit |
| 3673 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. | 3673 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. |
| 3674 * | 3674 * |
| 3675 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or | 3675 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or |
| 3676 * inherited in a concrete class unless that member overrides a concrete one. | 3676 * inherited in a concrete class unless that member overrides a concrete one. |
| 3677 * | 3677 * |
| 3678 * @param memberName the name of the first member | 3678 * @param memberName the name of the first member |
| 3679 * @param memberName the name of the second member | 3679 * @param memberName the name of the second member |
| 3680 * @param memberName the name of the third member | 3680 * @param memberName the name of the third member |
| 3681 * @param memberName the name of the fourth member | 3681 * @param memberName the name of the fourth member |
| 3682 * @param additionalCount the number of additional missing members that aren't listed | 3682 * @param additionalCount the number of additional missing members that aren't listed |
| 3683 */ | 3683 */ |
| 3684 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMB ER_FIVE_PLUS', 53, "Missing concrete implementation of %s, %s, %s, %s and %d mor e"); | 3684 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = const StaticWarningCode.con1("NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMB ER_FIVE_PLUS", 53, "Missing concrete implementation of {0}, {1}, {2}, {3} and {4 } more"); |
| 3685 | 3685 |
| 3686 /** | 3686 /** |
| 3687 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an | 3687 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an |
| 3688 * abstract method. | 3688 * abstract method. |
| 3689 * | 3689 * |
| 3690 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own | 3690 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own |
| 3691 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> | 3691 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> |
| 3692 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit | 3692 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit |
| 3693 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. | 3693 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. |
| 3694 * | 3694 * |
| 3695 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or | 3695 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or |
| 3696 * inherited in a concrete class unless that member overrides a concrete one. | 3696 * inherited in a concrete class unless that member overrides a concrete one. |
| 3697 * | 3697 * |
| 3698 * @param memberName the name of the first member | 3698 * @param memberName the name of the first member |
| 3699 * @param memberName the name of the second member | 3699 * @param memberName the name of the second member |
| 3700 * @param memberName the name of the third member | 3700 * @param memberName the name of the third member |
| 3701 * @param memberName the name of the fourth member | 3701 * @param memberName the name of the fourth member |
| 3702 */ | 3702 */ |
| 3703 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FO UR', 54, "Missing concrete implementation of %s, %s, %s and %s"); | 3703 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = const StaticWarningCode.con1("NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FO UR", 54, "Missing concrete implementation of {0}, {1}, {2} and {3}"); |
| 3704 | 3704 |
| 3705 /** | 3705 /** |
| 3706 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an | 3706 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an |
| 3707 * abstract method. | 3707 * abstract method. |
| 3708 * | 3708 * |
| 3709 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own | 3709 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own |
| 3710 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> | 3710 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> |
| 3711 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit | 3711 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit |
| 3712 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. | 3712 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. |
| 3713 * | 3713 * |
| 3714 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or | 3714 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or |
| 3715 * inherited in a concrete class unless that member overrides a concrete one. | 3715 * inherited in a concrete class unless that member overrides a concrete one. |
| 3716 * | 3716 * |
| 3717 * @param memberName the name of the member | 3717 * @param memberName the name of the member |
| 3718 */ | 3718 */ |
| 3719 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE ', 55, "Missing concrete implementation of %s"); | 3719 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode.con1("NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE ", 55, "Missing concrete implementation of {0}"); |
| 3720 | 3720 |
| 3721 /** | 3721 /** |
| 3722 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an | 3722 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an |
| 3723 * abstract method. | 3723 * abstract method. |
| 3724 * | 3724 * |
| 3725 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own | 3725 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own |
| 3726 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> | 3726 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> |
| 3727 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit | 3727 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit |
| 3728 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. | 3728 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. |
| 3729 * | 3729 * |
| 3730 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or | 3730 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or |
| 3731 * inherited in a concrete class unless that member overrides a concrete one. | 3731 * inherited in a concrete class unless that member overrides a concrete one. |
| 3732 * | 3732 * |
| 3733 * @param memberName the name of the first member | 3733 * @param memberName the name of the first member |
| 3734 * @param memberName the name of the second member | 3734 * @param memberName the name of the second member |
| 3735 * @param memberName the name of the third member | 3735 * @param memberName the name of the third member |
| 3736 */ | 3736 */ |
| 3737 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_T HREE', 56, "Missing concrete implementation of %s, %s and %s"); | 3737 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = const StaticWarningCode.con1("NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_T HREE", 56, "Missing concrete implementation of {0}, {1} and {2}"); |
| 3738 | 3738 |
| 3739 /** | 3739 /** |
| 3740 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an | 3740 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an |
| 3741 * abstract method. | 3741 * abstract method. |
| 3742 * | 3742 * |
| 3743 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own | 3743 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own |
| 3744 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> | 3744 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> |
| 3745 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit | 3745 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit |
| 3746 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. | 3746 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. |
| 3747 * | 3747 * |
| 3748 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or | 3748 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or |
| 3749 * inherited in a concrete class unless that member overrides a concrete one. | 3749 * inherited in a concrete class unless that member overrides a concrete one. |
| 3750 * | 3750 * |
| 3751 * @param memberName the name of the first member | 3751 * @param memberName the name of the first member |
| 3752 * @param memberName the name of the second member | 3752 * @param memberName the name of the second member |
| 3753 */ | 3753 */ |
| 3754 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO ', 57, "Missing concrete implementation of %s and %s"); | 3754 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode.con1("NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO ", 57, "Missing concrete implementation of {0} and {1}"); |
| 3755 | 3755 |
| 3756 /** | 3756 /** |
| 3757 * 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 | 3757 * 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 |
| 3758 * <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 | 3758 * <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 |
| 3759 * is a static warning if <i>T</i> does not denote a type available in the lex ical scope of the | 3759 * is a static warning if <i>T</i> does not denote a type available in the lex ical scope of the |
| 3760 * catch clause. | 3760 * catch clause. |
| 3761 * | 3761 * |
| 3762 * @param name the name of the non-type element | 3762 * @param name the name of the non-type element |
| 3763 */ | 3763 */ |
| 3764 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningC ode.con1('NON_TYPE_IN_CATCH_CLAUSE', 58, "The name '%s' is not a type and cannot be used in an on-catch clause"); | 3764 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningC ode.con1("NON_TYPE_IN_CATCH_CLAUSE", 58, "The name '{0}' is not a type and canno t be used in an on-catch clause"); |
| 3765 | 3765 |
| 3766 /** | 3766 /** |
| 3767 * 7.1.1 Operators: It is a static warning if the return type of the user-decl ared operator []= is | 3767 * 7.1.1 Operators: It is a static warning if the return type of the user-decl ared operator []= is |
| 3768 * explicitly declared and not void. | 3768 * explicitly declared and not void. |
| 3769 */ | 3769 */ |
| 3770 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarn ingCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 59, "The return type of the operato r []= must be 'void'"); | 3770 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarn ingCode.con1("NON_VOID_RETURN_FOR_OPERATOR", 59, "The return type of the operato r []= must be 'void'"); |
| 3771 | 3771 |
| 3772 /** | 3772 /** |
| 3773 * 7.3 Setters: It is a static warning if a setter declares a return type othe r than void. | 3773 * 7.3 Setters: It is a static warning if a setter declares a return type othe r than void. |
| 3774 */ | 3774 */ |
| 3775 static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarnin gCode.con1('NON_VOID_RETURN_FOR_SETTER', 60, "The return type of the setter must be 'void'"); | 3775 static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarnin gCode.con1("NON_VOID_RETURN_FOR_SETTER", 60, "The return type of the setter must be 'void'"); |
| 3776 | 3776 |
| 3777 /** | 3777 /** |
| 3778 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for m <i>id</i> or the | 3778 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for m <i>id</i> or the |
| 3779 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</ i> (respectively | 3779 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</ i> (respectively |
| 3780 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet er in the | 3780 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet er in the |
| 3781 * enclosing lexical scope, but occurs in the signature or body of a static me mber. * | 3781 * enclosing lexical scope, but occurs in the signature or body of a static me mber. * |
| 3782 * <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<s ub>n</sub>></i>, | 3782 * <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<s ub>n</sub>></i>, |
| 3783 * | 3783 * |
| 3784 * Any use of a malformed type gives rise to a static warning. | 3784 * Any use of a malformed type gives rise to a static warning. |
| 3785 * | 3785 * |
| 3786 * @param nonTypeName the name that is not a type | 3786 * @param nonTypeName the name that is not a type |
| 3787 */ | 3787 */ |
| 3788 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode.con1('NOT_ A_TYPE', 61, "%s is not a type"); | 3788 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode.con1("NOT_ A_TYPE", 61, "{0} is not a type"); |
| 3789 | 3789 |
| 3790 /** | 3790 /** |
| 3791 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</ i> or if <i>m > | 3791 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</ i> or if <i>m > |
| 3792 * n</i>. | 3792 * n</i>. |
| 3793 * | 3793 * |
| 3794 * @param requiredCount the expected number of required arguments | 3794 * @param requiredCount the expected number of required arguments |
| 3795 * @param argumentCount the actual number of positional arguments given | 3795 * @param argumentCount the actual number of positional arguments given |
| 3796 * @see #EXTRA_POSITIONAL_ARGUMENTS | 3796 * @see #EXTRA_POSITIONAL_ARGUMENTS |
| 3797 */ | 3797 */ |
| 3798 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar ningCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 62, "%d required argument(s) expe cted, but %d found"); | 3798 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar ningCode.con1("NOT_ENOUGH_REQUIRED_ARGUMENTS", 62, "{0} required argument(s) exp ected, but {1} found"); |
| 3799 | 3799 |
| 3800 /** | 3800 /** |
| 3801 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p< /i> names a library | 3801 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p< /i> names a library |
| 3802 * other than the current library as the library to which <i>p</i> belongs. | 3802 * other than the current library as the library to which <i>p</i> belongs. |
| 3803 * | 3803 * |
| 3804 * @param expectedLibraryName the name of expected library name | 3804 * @param expectedLibraryName the name of expected library name |
| 3805 * @param actualLibraryName the non-matching actual library name from the "par t of" declaration | 3805 * @param actualLibraryName the non-matching actual library name from the "par t of" declaration |
| 3806 */ | 3806 */ |
| 3807 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarning Code.con1('PART_OF_DIFFERENT_LIBRARY', 63, "Expected this library to be part of '%s', not '%s'"); | 3807 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarning Code.con1("PART_OF_DIFFERENT_LIBRARY", 63, "Expected this library to be part of '{0}', not '{1}'"); |
| 3808 | 3808 |
| 3809 /** | 3809 /** |
| 3810 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of | 3810 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of |
| 3811 * the type of <i>k</i>. | 3811 * the type of <i>k</i>. |
| 3812 * | 3812 * |
| 3813 * @param redirectedName the name of the redirected constructor | 3813 * @param redirectedName the name of the redirected constructor |
| 3814 * @param redirectingName the name of the redirecting constructor | 3814 * @param redirectingName the name of the redirecting constructor |
| 3815 */ | 3815 */ |
| 3816 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const Stati cWarningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 64, "The redirected const ructor '%s' has incompatible parameters with '%s'"); | 3816 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const Stati cWarningCode.con1("REDIRECT_TO_INVALID_FUNCTION_TYPE", 64, "The redirected const ructor '{0}' has incompatible parameters with '{1}'"); |
| 3817 | 3817 |
| 3818 /** | 3818 /** |
| 3819 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of | 3819 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of |
| 3820 * the type of <i>k</i>. | 3820 * the type of <i>k</i>. |
| 3821 * | 3821 * |
| 3822 * @param redirectedName the name of the redirected constructor return type | 3822 * @param redirectedName the name of the redirected constructor return type |
| 3823 * @param redirectingName the name of the redirecting constructor return type | 3823 * @param redirectingName the name of the redirecting constructor return type |
| 3824 */ | 3824 */ |
| 3825 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticW arningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 65, "The return type '%s' of the redirected constructor is not assignable to '%s'"); | 3825 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticW arningCode.con1("REDIRECT_TO_INVALID_RETURN_TYPE", 65, "The return type '{0}' of the redirected constructor is not assignable to '{1}'"); |
| 3826 | 3826 |
| 3827 /** | 3827 /** |
| 3828 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the | 3828 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the |
| 3829 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the | 3829 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the |
| 3830 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. | 3830 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. |
| 3831 */ | 3831 */ |
| 3832 static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticW arningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 66, "The constructor '%s' cou ld not be found in '%s'"); | 3832 static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticW arningCode.con1("REDIRECT_TO_MISSING_CONSTRUCTOR", 66, "The constructor '{0}' co uld not be found in '{1}'"); |
| 3833 | 3833 |
| 3834 /** | 3834 /** |
| 3835 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the | 3835 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the |
| 3836 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the | 3836 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the |
| 3837 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. | 3837 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. |
| 3838 */ | 3838 */ |
| 3839 static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode .con1('REDIRECT_TO_NON_CLASS', 67, "The name '%s' is not a type and cannot be us ed in a redirected constructor"); | 3839 static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode .con1("REDIRECT_TO_NON_CLASS", 67, "The name '{0}' is not a type and cannot be u sed in a redirected constructor"); |
| 3840 | 3840 |
| 3841 /** | 3841 /** |
| 3842 * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return s tatement of the form | 3842 * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return s tatement of the form |
| 3843 * <i>return;</i> It is a static warning if both of the following conditions h old: | 3843 * <i>return;</i> It is a static warning if both of the following conditions h old: |
| 3844 * <ol> | 3844 * <ol> |
| 3845 * * <i>f</i> is not a generative constructor. | 3845 * * <i>f</i> is not a generative constructor. |
| 3846 * * The return type of <i>f</i> may not be assigned to void. | 3846 * * The return type of <i>f</i> may not be assigned to void. |
| 3847 * </ol> | 3847 * </ol> |
| 3848 */ | 3848 */ |
| 3849 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode. con1('RETURN_WITHOUT_VALUE', 68, "Missing return value after 'return'"); | 3849 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode. con1("RETURN_WITHOUT_VALUE", 68, "Missing return value after 'return'"); |
| 3850 | 3850 |
| 3851 /** | 3851 /** |
| 3852 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method | 3852 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method |
| 3853 * or getter <i>m</i>. | 3853 * or getter <i>m</i>. |
| 3854 * | 3854 * |
| 3855 * @param memberName the name of the instance member | 3855 * @param memberName the name of the instance member |
| 3856 */ | 3856 */ |
| 3857 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const Static WarningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 69, "Instance member '%s' c annot be accessed using static access"); | 3857 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const Static WarningCode.con1("STATIC_ACCESS_TO_INSTANCE_MEMBER", 69, "Instance member '{0}' cannot be accessed using static access"); |
| 3858 | 3858 |
| 3859 /** | 3859 /** |
| 3860 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi gned to the type of | 3860 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi gned to the type of |
| 3861 * <i>e<sub>k</sub></i>. | 3861 * <i>e<sub>k</sub></i>. |
| 3862 */ | 3862 */ |
| 3863 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const Static WarningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 70, "Type '%s' of the switc h expression is not assignable to the type '%s' of case expressions"); | 3863 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const Static WarningCode.con1("SWITCH_EXPRESSION_NOT_ASSIGNABLE", 70, "Type '{0}' of the swit ch expression is not assignable to the type '{1}' of case expressions"); |
| 3864 | 3864 |
| 3865 /** | 3865 /** |
| 3866 * 15.1 Static Types: It is a static warning to use a deferred type in a type annotation. | 3866 * 15.1 Static Types: It is a static warning to use a deferred type in a type annotation. |
| 3867 * | 3867 * |
| 3868 * @param name the name of the type that is deferred and being used in a type annotation | 3868 * @param name the name of the type that is deferred and being used in a type annotation |
| 3869 */ | 3869 */ |
| 3870 static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWa rningCode.con1('TYPE_ANNOTATION_DEFERRED_CLASS', 71, "The deferred type '%s' can not be used in a declaration, cast or type test"); | 3870 static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWa rningCode.con1("TYPE_ANNOTATION_DEFERRED_CLASS", 71, "The deferred type '{0}' ca nnot be used in a declaration, cast or type test"); |
| 3871 | 3871 |
| 3872 /** | 3872 /** |
| 3873 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the | 3873 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the |
| 3874 * current lexical scope. | 3874 * current lexical scope. |
| 3875 */ | 3875 */ |
| 3876 static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode.co n1('TYPE_TEST_NON_TYPE', 72, "The name '%s' is not a type and cannot be used in an 'is' expression"); | 3876 static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode.co n1("TYPE_TEST_NON_TYPE", 72, "The name '{0}' is not a type and cannot be used in an 'is' expression"); |
| 3877 | 3877 |
| 3878 /** | 3878 /** |
| 3879 * 10 Generics: However, a type parameter is considered to be a malformed type when referenced by | 3879 * 10 Generics: However, a type parameter is considered to be a malformed type when referenced by |
| 3880 * a static member. | 3880 * a static member. |
| 3881 * | 3881 * |
| 3882 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni ng. A malformed type | 3882 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni ng. A malformed type |
| 3883 * is then interpreted as dynamic by the static type checker and the runtime. | 3883 * is then interpreted as dynamic by the static type checker and the runtime. |
| 3884 */ | 3884 */ |
| 3885 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const Sta ticWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 73, "Static members c annot reference type parameters"); | 3885 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const Sta ticWarningCode.con1("TYPE_PARAMETER_REFERENCED_BY_STATIC", 73, "Static members c annot reference type parameters"); |
| 3886 | 3886 |
| 3887 /** | 3887 /** |
| 3888 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form | 3888 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form |
| 3889 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, … | 3889 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, … |
| 3890 * 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 | 3890 * 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 |
| 3891 * class in the current scope. | 3891 * class in the current scope. |
| 3892 * | 3892 * |
| 3893 * @param undefinedClassName the name of the undefined class | 3893 * @param undefinedClassName the name of the undefined class |
| 3894 */ | 3894 */ |
| 3895 static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode.con1( 'UNDEFINED_CLASS', 74, "Undefined class '%s'"); | 3895 static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode.con1( "UNDEFINED_CLASS", 74, "Undefined class '{0}'"); |
| 3896 | 3896 |
| 3897 /** | 3897 /** |
| 3898 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". | 3898 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". |
| 3899 */ | 3899 */ |
| 3900 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCo de.con1('UNDEFINED_CLASS_BOOLEAN', 75, "Undefined class 'boolean'; did you mean 'bool'?"); | 3900 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCo de.con1("UNDEFINED_CLASS_BOOLEAN", 75, "Undefined class 'boolean'; did you mean 'bool'?"); |
| 3901 | 3901 |
| 3902 /** | 3902 /** |
| 3903 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing | 3903 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing |
| 3904 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter | 3904 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter |
| 3905 * named <i>m</i>. | 3905 * named <i>m</i>. |
| 3906 * | 3906 * |
| 3907 * @param getterName the name of the getter | 3907 * @param getterName the name of the getter |
| 3908 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for | 3908 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for |
| 3909 */ | 3909 */ |
| 3910 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode.con1 ('UNDEFINED_GETTER', 76, "There is no such getter '%s' in '%s'"); | 3910 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode.con1 ("UNDEFINED_GETTER", 76, "There is no such getter '{0}' in '{1}'"); |
| 3911 | 3911 |
| 3912 /** | 3912 /** |
| 3913 * 12.30 Identifier Reference: It is as static warning if an identifier expres sion of the form | 3913 * 12.30 Identifier Reference: It is as static warning if an identifier expres sion of the form |
| 3914 * <i>id</i> occurs inside a top level or static function (be it function, met hod, getter, or | 3914 * <i>id</i> occurs inside a top level or static function (be it function, met hod, getter, or |
| 3915 * setter) or variable initializer and there is no declaration <i>d</i> with n ame <i>id</i> in the | 3915 * setter) or variable initializer and there is no declaration <i>d</i> with n ame <i>id</i> in the |
| 3916 * lexical scope enclosing the expression. | 3916 * lexical scope enclosing the expression. |
| 3917 * | 3917 * |
| 3918 * @param name the name of the identifier | 3918 * @param name the name of the identifier |
| 3919 */ | 3919 */ |
| 3920 static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode. con1('UNDEFINED_IDENTIFIER', 77, "Undefined name '%s'"); | 3920 static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode. con1("UNDEFINED_IDENTIFIER", 77, "Undefined name '{0}'"); |
| 3921 | 3921 |
| 3922 /** | 3922 /** |
| 3923 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, | 3923 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, |
| 3924 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > … | 3924 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > … |
| 3925 * <i>p<sub>n+k</sub></i>} or a static warning occurs. | 3925 * <i>p<sub>n+k</sub></i>} or a static warning occurs. |
| 3926 * | 3926 * |
| 3927 * @param name the name of the requested named parameter | 3927 * @param name the name of the requested named parameter |
| 3928 */ | 3928 */ |
| 3929 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarning Code.con1('UNDEFINED_NAMED_PARAMETER', 78, "The named parameter '%s' is not defi ned"); | 3929 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarning Code.con1("UNDEFINED_NAMED_PARAMETER", 78, "The named parameter '{0}' is not def ined"); |
| 3930 | 3930 |
| 3931 /** | 3931 /** |
| 3932 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs | 3932 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs |
| 3933 * inside a top level or static function (be it function, method, getter, or s etter) or variable | 3933 * inside a top level or static function (be it function, method, getter, or s etter) or variable |
| 3934 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope | 3934 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope |
| 3935 * enclosing the assignment. | 3935 * enclosing the assignment. |
| 3936 * | 3936 * |
| 3937 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t he enclosing lexical | 3937 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t he enclosing lexical |
| 3938 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp licitly, a setter | 3938 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp licitly, a setter |
| 3939 * <i>v=</i>. | 3939 * <i>v=</i>. |
| 3940 * | 3940 * |
| 3941 * @param setterName the name of the getter | 3941 * @param setterName the name of the getter |
| 3942 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for | 3942 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for |
| 3943 */ | 3943 */ |
| 3944 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode.con1 ('UNDEFINED_SETTER', 79, "There is no such setter '%s' in '%s'"); | 3944 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode.con1 ("UNDEFINED_SETTER", 79, "There is no such setter '{0}' in '{1}'"); |
| 3945 | 3945 |
| 3946 /** | 3946 /** |
| 3947 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method | 3947 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method |
| 3948 * or getter <i>m</i>. | 3948 * or getter <i>m</i>. |
| 3949 * | 3949 * |
| 3950 * @param methodName the name of the method | 3950 * @param methodName the name of the method |
| 3951 * @param enclosingType the name of the enclosing type where the method is bei ng looked for | 3951 * @param enclosingType the name of the enclosing type where the method is bei ng looked for |
| 3952 */ | 3952 */ |
| 3953 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const Stati cWarningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 80, "There is no such sta tic method, getter or setter '%s' in '%s'"); | 3953 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const Stati cWarningCode.con1("UNDEFINED_STATIC_METHOD_OR_GETTER", 80, "There is no such sta tic method, getter or setter '{0}' in '{1}'"); |
| 3954 | 3954 |
| 3955 /** | 3955 /** |
| 3956 * 7.2 Getters: It is a static warning if the return type of a getter is void. | 3956 * 7.2 Getters: It is a static warning if the return type of a getter is void. |
| 3957 */ | 3957 */ |
| 3958 static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCod e.con1('VOID_RETURN_FOR_GETTER', 81, "The return type of the getter must not be 'void'"); | 3958 static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCod e.con1("VOID_RETURN_FOR_GETTER", 81, "The return type of the getter must not be 'void'"); |
| 3959 | 3959 |
| 3960 static const List<StaticWarningCode> values = const [ | 3960 static const List<StaticWarningCode> values = const [ |
| 3961 AMBIGUOUS_IMPORT, | 3961 AMBIGUOUS_IMPORT, |
| 3962 ARGUMENT_TYPE_NOT_ASSIGNABLE, | 3962 ARGUMENT_TYPE_NOT_ASSIGNABLE, |
| 3963 ASSIGNMENT_TO_CONST, | 3963 ASSIGNMENT_TO_CONST, |
| 3964 ASSIGNMENT_TO_FINAL, | 3964 ASSIGNMENT_TO_FINAL, |
| 3965 ASSIGNMENT_TO_FINAL_NO_SETTER, | 3965 ASSIGNMENT_TO_FINAL_NO_SETTER, |
| 3966 ASSIGNMENT_TO_FUNCTION, | 3966 ASSIGNMENT_TO_FUNCTION, |
| 3967 ASSIGNMENT_TO_METHOD, | 3967 ASSIGNMENT_TO_METHOD, |
| 3968 CASE_BLOCK_NOT_TERMINATED, | 3968 CASE_BLOCK_NOT_TERMINATED, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4077 String get uniqueName => "${runtimeType.toString()}.${name}"; | 4077 String get uniqueName => "${runtimeType.toString()}.${name}"; |
| 4078 } | 4078 } |
| 4079 | 4079 |
| 4080 /** | 4080 /** |
| 4081 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. | 4081 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. |
| 4082 */ | 4082 */ |
| 4083 class TodoCode extends Enum<TodoCode> implements ErrorCode { | 4083 class TodoCode extends Enum<TodoCode> implements ErrorCode { |
| 4084 /** | 4084 /** |
| 4085 * The single enum of TodoCode. | 4085 * The single enum of TodoCode. |
| 4086 */ | 4086 */ |
| 4087 static const TodoCode TODO = const TodoCode('TODO', 0); | 4087 static const TodoCode TODO = const TodoCode("TODO", 0); |
| 4088 | 4088 |
| 4089 static const List<TodoCode> values = const [TODO]; | 4089 static const List<TodoCode> values = const [TODO]; |
| 4090 | 4090 |
| 4091 /** | 4091 /** |
| 4092 * This matches the two common Dart task styles | 4092 * This matches the two common Dart task styles |
| 4093 * | 4093 * |
| 4094 * * TODO: | 4094 * * TODO: |
| 4095 * * TODO(username): | 4095 * * TODO(username): |
| 4096 * | 4096 * |
| 4097 * As well as | 4097 * As well as |
| 4098 * * TODO | 4098 * * TODO |
| 4099 * | 4099 * |
| 4100 * But not | 4100 * But not |
| 4101 * * todo | 4101 * * todo |
| 4102 * * TODOS | 4102 * * TODOS |
| 4103 */ | 4103 */ |
| 4104 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|( TODO:?\$))"); | 4104 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|( TODO:?\$))"); |
| 4105 | 4105 |
| 4106 const TodoCode(String name, int ordinal) : super(name, ordinal); | 4106 const TodoCode(String name, int ordinal) : super(name, ordinal); |
| 4107 | 4107 |
| 4108 @override | 4108 @override |
| 4109 String get correction => null; | 4109 String get correction => null; |
| 4110 | 4110 |
| 4111 @override | 4111 @override |
| 4112 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 4112 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
| 4113 | 4113 |
| 4114 @override | 4114 @override |
| 4115 String get message => "%s"; | 4115 String get message => "{0}"; |
| 4116 | 4116 |
| 4117 @override | 4117 @override |
| 4118 ErrorType get type => ErrorType.TODO; | 4118 ErrorType get type => ErrorType.TODO; |
| 4119 | 4119 |
| 4120 @override | 4120 @override |
| 4121 String get uniqueName => "${runtimeType.toString()}.${name}"; | 4121 String get uniqueName => "${runtimeType.toString()}.${name}"; |
| 4122 } | 4122 } |
| OLD | NEW |