OLD | NEW |
| (Empty) |
1 // This code was auto-generated, is not intended to be edited, and is subject to | |
2 // significant change. Please see the README file for more information. | |
3 | |
4 library engine.error; | |
5 | |
6 import 'java_core.dart'; | |
7 import 'source.dart'; | |
8 import 'ast.dart' show ASTNode; | |
9 import 'scanner.dart' show Token; | |
10 | |
11 /** | |
12 * Instances of the enumeration {@code ErrorSeverity} represent the severity of
an {@link ErrorCode}. | |
13 * @coverage dart.engine.error | |
14 */ | |
15 class ErrorSeverity { | |
16 /** | |
17 * The severity representing a non-error. This is never used for any error cod
e, but is useful for | |
18 * clients. | |
19 */ | |
20 static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none"); | |
21 /** | |
22 * The severity representing a warning. Warnings can become errors if the {@co
de -Werror} command | |
23 * line flag is specified. | |
24 */ | |
25 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 1, "W", "war
ning"); | |
26 /** | |
27 * The severity representing an error. | |
28 */ | |
29 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 2, "E", "error")
; | |
30 static final List<ErrorSeverity> values = [NONE, WARNING, ERROR]; | |
31 final String __name; | |
32 final int __ordinal; | |
33 int get ordinal => __ordinal; | |
34 /** | |
35 * The name of the severity used when producing machine output. | |
36 */ | |
37 String _machineCode; | |
38 /** | |
39 * The name of the severity used when producing readable output. | |
40 */ | |
41 String _displayName; | |
42 /** | |
43 * Initialize a newly created severity with the given names. | |
44 * @param machineCode the name of the severity used when producing machine out
put | |
45 * @param displayName the name of the severity used when producing readable ou
tput | |
46 */ | |
47 ErrorSeverity(this.__name, this.__ordinal, String machineCode, String displayN
ame) { | |
48 this._machineCode = machineCode; | |
49 this._displayName = displayName; | |
50 } | |
51 /** | |
52 * Return the name of the severity used when producing readable output. | |
53 * @return the name of the severity used when producing readable output | |
54 */ | |
55 String get displayName => _displayName; | |
56 /** | |
57 * Return the name of the severity used when producing machine output. | |
58 * @return the name of the severity used when producing machine output | |
59 */ | |
60 String get machineCode => _machineCode; | |
61 /** | |
62 * Return the severity constant that represents the greatest severity. | |
63 * @param severity the severity being compared against | |
64 * @return the most sever of this or the given severity | |
65 */ | |
66 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal
? this : severity; | |
67 String toString() => __name; | |
68 } | |
69 /** | |
70 * Instances of the class {@code ErrorReporter} wrap an error listener with util
ity methods used to | |
71 * create the errors being reported. | |
72 * @coverage dart.engine.error | |
73 */ | |
74 class ErrorReporter { | |
75 /** | |
76 * The error listener to which errors will be reported. | |
77 */ | |
78 AnalysisErrorListener _errorListener; | |
79 /** | |
80 * The default source to be used when reporting errors. | |
81 */ | |
82 Source _defaultSource; | |
83 /** | |
84 * The source to be used when reporting errors. | |
85 */ | |
86 Source _source; | |
87 /** | |
88 * Initialize a newly created error reporter that will report errors to the gi
ven listener. | |
89 * @param errorListener the error listener to which errors will be reported | |
90 * @param defaultSource the default source to be used when reporting errors | |
91 */ | |
92 ErrorReporter(AnalysisErrorListener errorListener, Source defaultSource) { | |
93 if (errorListener == null) { | |
94 throw new IllegalArgumentException("An error listener must be provided"); | |
95 } else if (defaultSource == null) { | |
96 throw new IllegalArgumentException("A default source must be provided"); | |
97 } | |
98 this._errorListener = errorListener; | |
99 this._defaultSource = defaultSource; | |
100 this._source = defaultSource; | |
101 } | |
102 /** | |
103 * Report an error with the given error code and arguments. | |
104 * @param errorCode the error code of the error to be reported | |
105 * @param node the node specifying the location of the error | |
106 * @param arguments the arguments to the error, used to compose the error mess
age | |
107 */ | |
108 void reportError(ErrorCode errorCode, ASTNode node, List<Object> arguments) { | |
109 _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.len
gth, errorCode, [arguments])); | |
110 } | |
111 /** | |
112 * Report an error with the given error code and arguments. | |
113 * @param errorCode the error code of the error to be reported | |
114 * @param token the token specifying the location of the error | |
115 * @param arguments the arguments to the error, used to compose the error mess
age | |
116 */ | |
117 void reportError2(ErrorCode errorCode, Token token, List<Object> arguments) { | |
118 _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.l
ength, errorCode, [arguments])); | |
119 } | |
120 /** | |
121 * Set the source to be used when reporting errors. Setting the source to {@co
de null} will cause | |
122 * the default source to be used. | |
123 * @param source the source to be used when reporting errors | |
124 */ | |
125 void set source(Source source7) { | |
126 this._source = source7 == null ? _defaultSource : source7; | |
127 } | |
128 } | |
129 /** | |
130 * Instances of the class {@code AnalysisError} represent an error discovered du
ring the analysis of | |
131 * some Dart code. | |
132 * @see AnalysisErrorListener | |
133 * @coverage dart.engine.error | |
134 */ | |
135 class AnalysisError { | |
136 /** | |
137 * An empty array of errors used when no errors are expected. | |
138 */ | |
139 static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0); | |
140 /** | |
141 * The error code associated with the error. | |
142 */ | |
143 ErrorCode _errorCode; | |
144 /** | |
145 * The localized error message. | |
146 */ | |
147 String _message; | |
148 /** | |
149 * The source in which the error occurred, or {@code null} if unknown. | |
150 */ | |
151 Source _source; | |
152 /** | |
153 * The character offset from the beginning of the source (zero based) where th
e error occurred. | |
154 */ | |
155 int _offset = 0; | |
156 /** | |
157 * The number of characters from the offset to the end of the source which enc
ompasses the | |
158 * compilation error. | |
159 */ | |
160 int _length = 0; | |
161 /** | |
162 * Initialize a newly created analysis error for the specified source. The err
or has no location | |
163 * information. | |
164 * @param source the source for which the exception occurred | |
165 * @param errorCode the error code to be associated with this error | |
166 * @param arguments the arguments used to build the error message | |
167 */ | |
168 AnalysisError.con1(Source source2, ErrorCode errorCode2, List<Object> argument
s) { | |
169 _jtd_constructor_127_impl(source2, errorCode2, arguments); | |
170 } | |
171 _jtd_constructor_127_impl(Source source2, ErrorCode errorCode2, List<Object> a
rguments) { | |
172 this._source = source2; | |
173 this._errorCode = errorCode2; | |
174 this._message = JavaString.format(errorCode2.message, arguments); | |
175 } | |
176 /** | |
177 * Initialize a newly created analysis error for the specified source at the g
iven location. | |
178 * @param source the source for which the exception occurred | |
179 * @param offset the offset of the location of the error | |
180 * @param length the length of the location of the error | |
181 * @param errorCode the error code to be associated with this error | |
182 * @param arguments the arguments used to build the error message | |
183 */ | |
184 AnalysisError.con2(Source source3, int offset2, int length11, ErrorCode errorC
ode3, List<Object> arguments) { | |
185 _jtd_constructor_128_impl(source3, offset2, length11, errorCode3, arguments)
; | |
186 } | |
187 _jtd_constructor_128_impl(Source source3, int offset2, int length11, ErrorCode
errorCode3, List<Object> arguments) { | |
188 this._source = source3; | |
189 this._offset = offset2; | |
190 this._length = length11; | |
191 this._errorCode = errorCode3; | |
192 this._message = JavaString.format(errorCode3.message, arguments); | |
193 } | |
194 /** | |
195 * Return the error code associated with the error. | |
196 * @return the error code associated with the error | |
197 */ | |
198 ErrorCode get errorCode => _errorCode; | |
199 /** | |
200 * Return the number of characters from the offset to the end of the source wh
ich encompasses the | |
201 * compilation error. | |
202 * @return the length of the error location | |
203 */ | |
204 int get length => _length; | |
205 /** | |
206 * Return the localized error message. | |
207 * @return the localized error message | |
208 */ | |
209 String get message => _message; | |
210 /** | |
211 * Return the character offset from the beginning of the source (zero based) w
here the error | |
212 * occurred. | |
213 * @return the offset to the start of the error location | |
214 */ | |
215 int get offset => _offset; | |
216 /** | |
217 * Return the source in which the error occurred, or {@code null} if unknown. | |
218 * @return the source in which the error occurred | |
219 */ | |
220 Source get source => _source; | |
221 int get hashCode { | |
222 int hashCode = _offset; | |
223 hashCode ^= (_message != null) ? _message.hashCode : 0; | |
224 hashCode ^= (_source != null) ? _source.hashCode : 0; | |
225 return hashCode; | |
226 } | |
227 /** | |
228 * Set the source in which the error occurred to the given source. | |
229 * @param source the source in which the error occurred | |
230 */ | |
231 void set source(Source source4) { | |
232 this._source = source4; | |
233 } | |
234 String toString() { | |
235 JavaStringBuilder builder = new JavaStringBuilder(); | |
236 builder.append((_source != null) ? _source.fullName : "<unknown source>"); | |
237 builder.append("("); | |
238 builder.append(_offset); | |
239 builder.append(".."); | |
240 builder.append(_offset + _length - 1); | |
241 builder.append("): "); | |
242 builder.append(_message); | |
243 return builder.toString(); | |
244 } | |
245 } | |
246 /** | |
247 * The interface {@code ErrorCode} defines the behavior common to objects repres
enting error codes | |
248 * associated with {@link AnalysisError analysis errors}. | |
249 * @coverage dart.engine.error | |
250 */ | |
251 abstract class ErrorCode { | |
252 /** | |
253 * Return the severity of this error. | |
254 * @return the severity of this error | |
255 */ | |
256 ErrorSeverity get errorSeverity; | |
257 /** | |
258 * Return the message template used to create the message to be displayed for
this error. | |
259 * @return the message template used to create the message to be displayed for
this error | |
260 */ | |
261 String get message; | |
262 /** | |
263 * Return the type of the error. | |
264 * @return the type of the error | |
265 */ | |
266 ErrorType get type; | |
267 /** | |
268 * Return {@code true} if this error should cause recompilation of the source
during the next | |
269 * incremental compilation. | |
270 * @return {@code true} if this error should cause recompilation of the source
during the next | |
271 * incremental compilation | |
272 */ | |
273 bool needsRecompilation(); | |
274 } | |
275 /** | |
276 * Instances of the enumeration {@code ErrorType} represent the type of an {@lin
k ErrorCode}. | |
277 * @coverage dart.engine.error | |
278 */ | |
279 class ErrorType { | |
280 /** | |
281 * Compile-time errors are errors that preclude execution. A compile time erro
r must be reported | |
282 * by a Dart compiler before the erroneous code is executed. | |
283 */ | |
284 static final ErrorType COMPILE_TIME_ERROR = new ErrorType('COMPILE_TIME_ERROR'
, 0, ErrorSeverity.ERROR); | |
285 /** | |
286 * Static warnings are those warnings reported by the static checker. They hav
e no effect on | |
287 * execution. Static warnings must be provided by Dart compilers used during d
evelopment. | |
288 */ | |
289 static final ErrorType STATIC_WARNING = new ErrorType('STATIC_WARNING', 1, Err
orSeverity.WARNING); | |
290 /** | |
291 * Many, but not all, static warnings relate to types, in which case they are
known as static type | |
292 * warnings. | |
293 */ | |
294 static final ErrorType STATIC_TYPE_WARNING = new ErrorType('STATIC_TYPE_WARNIN
G', 2, ErrorSeverity.WARNING); | |
295 /** | |
296 * Syntactic errors are errors produced as a result of input that does not con
form to the grammar. | |
297 */ | |
298 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 3, E
rrorSeverity.ERROR); | |
299 static final List<ErrorType> values = [COMPILE_TIME_ERROR, STATIC_WARNING, STA
TIC_TYPE_WARNING, SYNTACTIC_ERROR]; | |
300 final String __name; | |
301 final int __ordinal; | |
302 int get ordinal => __ordinal; | |
303 /** | |
304 * The severity of this type of error. | |
305 */ | |
306 ErrorSeverity _severity; | |
307 /** | |
308 * Initialize a newly created error type to have the given severity. | |
309 * @param severity the severity of this type of error | |
310 */ | |
311 ErrorType(this.__name, this.__ordinal, ErrorSeverity severity) { | |
312 this._severity = severity; | |
313 } | |
314 /** | |
315 * Return the severity of this type of error. | |
316 * @return the severity of this type of error | |
317 */ | |
318 ErrorSeverity get severity => _severity; | |
319 String toString() => __name; | |
320 } | |
321 /** | |
322 * The enumeration {@code CompileTimeErrorCode} defines the error codes used for
compile time | |
323 * errors. The convention for this class is for the name of the error code to in
dicate the problem | |
324 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | |
325 * when appropriate, how the problem can be corrected. | |
326 * @coverage dart.engine.error | |
327 */ | |
328 class CompileTimeErrorCode implements ErrorCode { | |
329 /** | |
330 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
by a library | |
331 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b
y more than one | |
332 * export. | |
333 */ | |
334 static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode(
'AMBIGUOUS_EXPORT', 0, ""); | |
335 /** | |
336 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i
>N</i> is introduced | |
337 * into the top level scope <i>L</i> by more than one import then: | |
338 * <ol> | |
339 * <li>It is a static warning if <i>N</i> is used as a type annotation. | |
340 * <li>In checked mode, it is a dynamic error if <i>N</i> is used as a type an
notation and | |
341 * referenced during a subtype test. | |
342 * <li>Otherwise, it is a compile-time error. | |
343 * </ol> | |
344 */ | |
345 static final CompileTimeErrorCode AMBIGUOUS_IMPORT = new CompileTimeErrorCode(
'AMBIGUOUS_IMPORT', 1, ""); | |
346 /** | |
347 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
not denote a formal | |
348 * parameter. | |
349 * @param the name of the identifier in the argument definition test that is n
ot a parameter | |
350 */ | |
351 static final CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = new
CompileTimeErrorCode('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 2, "'%s' is not
a parameter"); | |
352 /** | |
353 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id
entifier other than | |
354 * dynamic as a type annotation. | |
355 */ | |
356 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = new CompileTim
eErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE', 3, "The built-in identifier '%s' canno
t be as a type"); | |
357 /** | |
358 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the | |
359 * declared name of a class, type parameter or type alias. | |
360 */ | |
361 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = new Compi
leTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 4, "The built-in identifier
'%s' cannot be used as a type name"); | |
362 /** | |
363 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the | |
364 * declared name of a class, type parameter or type alias. | |
365 */ | |
366 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = new Co
mpileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 5, "The built-in ident
ifier '%s' cannot be used as a type alias name"); | |
367 /** | |
368 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the | |
369 * declared name of a class, type parameter or type alias. | |
370 */ | |
371 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME =
new CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME', 6, "The bu
ilt-in identifier '%s' cannot be used as a type variable name"); | |
372 /** | |
373 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th
e operator | |
374 * <i>==</i>. | |
375 */ | |
376 static final CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = new
CompileTimeErrorCode('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 7, "The switch c
ase expression type '%s' cannot override the == operator"); | |
377 /** | |
378 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
constant would raise | |
379 * an exception. | |
380 */ | |
381 static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = new
CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 8, ""); | |
382 /** | |
383 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
constant would raise | |
384 * an exception. | |
385 */ | |
386 static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVID
E_BY_ZERO = new CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIV
IDE_BY_ZERO', 9, "Cannot divide by zero"); | |
387 /** | |
388 * 7.6 Constructors: A constructor name always begins with the name of its imm
ediately enclosing | |
389 * class, and may optionally be followed by a dot and an identifier <i>id</i>.
It is a | |
390 * compile-time error if <i>id</i> is the name of a member declared in the imm
ediately enclosing | |
391 * class. | |
392 */ | |
393 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new
CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 10, "'%s' cannot
be used to name a constructor and a method in this class"); | |
394 /** | |
395 * 7.6 Constructors: A constructor name always begins with the name of its imm
ediately enclosing | |
396 * class, and may optionally be followed by a dot and an identifier <i>id</i>.
It is a | |
397 * compile-time error if <i>id</i> is the name of a member declared in the imm
ediately enclosing | |
398 * class. | |
399 */ | |
400 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = ne
w CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 11, "'%s' cann
ot be used to name a constructor and a field in this class"); | |
401 /** | |
402 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const
ructor is declared | |
403 * by a class that has a non-final instance variable. | |
404 */ | |
405 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new
CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 12, "Classes wit
h non-final fields cannot define 'const' constructors"); | |
406 /** | |
407 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
declared as a | |
408 * constant variable. | |
409 */ | |
410 static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErro
rCode('CONST_FORMAL_PARAMETER', 13, "Parameters cannot be 'const'"); | |
411 /** | |
412 * 5 Variables: A constant variable must be initialized to a compile-time cons
tant or a | |
413 * compile-time error occurs. | |
414 */ | |
415 static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE =
new CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 14, ""); | |
416 /** | |
417 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | |
418 * uncaught exception being thrown. | |
419 */ | |
420 static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTim
eErrorCode('CONST_EVAL_THROWS_EXCEPTION', 15, ""); | |
421 /** | |
422 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, &
hellip;, | |
423 * U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time error if <i>S
</i> is not a | |
424 * generic type with <i>m</i> type parameters. | |
425 * @param typeName the name of the type being referenced (<i>S</i>) | |
426 * @param argumentCount the number of type arguments provided | |
427 * @param parameterCount the number of type parameters that were declared | |
428 */ | |
429 static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new Com
pileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', 16, "The type '%s' is de
clared with %d type parameters, but %d type arguments were given"); | |
430 /** | |
431 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip
;, a<sub>n</sub>, | |
432 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | |
433 * compile-time error if the type <i>T</i> does not declare a constant constru
ctor with the same | |
434 * name as the declaration of <i>T</i>. | |
435 */ | |
436 static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorC
ode('CONST_WITH_NON_CONST', 17, ""); | |
437 /** | |
438 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i>
a<sub>i</sub>, 1 | |
439 * <= i <= n + k</i>, is not a compile-time constant expression. | |
440 */ | |
441 static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new Compi
leTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', 18, ""); | |
442 /** | |
443 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access
ible in the current | |
444 * scope, optionally followed by type arguments. | |
445 * <p> | |
446 * 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>, | |
447 * x<sub>n+1</sub>: a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>
)</i> it is a | |
448 * compile-time error if <i>T</i> is not a class accessible in the current sco
pe, optionally | |
449 * followed by type arguments. | |
450 */ | |
451 static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCo
de('CONST_WITH_NON_TYPE', 19, ""); | |
452 /** | |
453 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par
ameters. | |
454 */ | |
455 static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTime
ErrorCode('CONST_WITH_TYPE_PARAMETERS', 20, ""); | |
456 /** | |
457 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
a constant | |
458 * constructor declared by the type <i>T</i>. | |
459 */ | |
460 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new Compi
leTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', 21, ""); | |
461 /** | |
462 * 15.3.1 Typedef: It is a compile-time error if any default values are specif
ied in the signature | |
463 * of a function type alias. | |
464 */ | |
465 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new C
ompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 22, ""); | |
466 /** | |
467 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name | |
468 * declared in the same scope. | |
469 * @param duplicateName the name of the duplicate entity | |
470 */ | |
471 static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorC
ode('DUPLICATE_DEFINITION', 23, "The name '%s' is already defined"); | |
472 /** | |
473 * 7 Classes: It is a compile-time error if a class declares two members of th
e same name. | |
474 */ | |
475 static final CompileTimeErrorCode DUPLICATE_MEMBER_NAME = new CompileTimeError
Code('DUPLICATE_MEMBER_NAME', 24, ""); | |
476 /** | |
477 * 7 Classes: It is a compile-time error if a class has an instance member and
a static member | |
478 * with the same name. | |
479 */ | |
480 static final CompileTimeErrorCode DUPLICATE_MEMBER_NAME_INSTANCE_STATIC = new
CompileTimeErrorCode('DUPLICATE_MEMBER_NAME_INSTANCE_STATIC', 25, ""); | |
481 /** | |
482 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub>
i</sub> = | |
483 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the
label for a named | |
484 * argument]. | |
485 */ | |
486 static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeEr
rorCode('DUPLICATE_NAMED_ARGUMENT', 26, ""); | |
487 /** | |
488 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is | |
489 * not a library declaration. | |
490 */ | |
491 static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeError
Code('EXPORT_OF_NON_LIBRARY', 27, ""); | |
492 /** | |
493 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla
ss <i>C</i> includes | |
494 * a type expression that does not denote a class available in the lexical sco
pe of <i>C</i>. | |
495 */ | |
496 static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode
('EXTENDS_NON_CLASS', 28, ""); | |
497 /** | |
498 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. | |
499 * <p> | |
500 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. | |
501 * <p> | |
502 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. | |
503 * <p> | |
504 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to | |
505 * attempt to extend or implement num. | |
506 * <p> | |
507 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. | |
508 * <p> | |
509 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. | |
510 */ | |
511 static final CompileTimeErrorCode EXTENDS_OR_IMPLEMENTS_DISALLOWED_CLASS = new
CompileTimeErrorCode('EXTENDS_OR_IMPLEMENTS_DISALLOWED_CLASS', 29, ""); | |
512 /** | |
513 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time | |
514 * error if more than one initializer corresponding to a given instance variab
le appears in | |
515 * <i>k</i>’s list. | |
516 */ | |
517 static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS =
new CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 30, ""); | |
518 /** | |
519 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time | |
520 * error if <i>k</i>’s initializer list contains an initializer for a final
variable <i>f</i> | |
521 * whose declaration includes an initialization expression. | |
522 */ | |
523 static final CompileTimeErrorCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARA
TION = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N', 31, ""); | |
524 /** | |
525 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time | |
526 * error if <i>k</i>’s initializer list contains an initializer for a variab
le that is initialized | |
527 * by means of an initializing formal of <i>k</i>. | |
528 */ | |
529 static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ
ER = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER',
32, ""); | |
530 /** | |
531 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by | |
532 * a function other than a non-redirecting generative constructor. | |
533 */ | |
534 static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new
CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 33, ""); | |
535 /** | |
536 * 5 Variables: It is a compile-time error if a final instance variable that h
as been initialized | |
537 * at its point of declaration is also initialized in a constructor. | |
538 */ | |
539 static final CompileTimeErrorCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRU
CTOR = new CompileTimeErrorCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO
R', 34, ""); | |
540 /** | |
541 * 5 Variables: It is a compile-time error if a final instance variable that h
as is initialized by | |
542 * means of an initializing formal of a constructor is also initialized elsewh
ere in the same | |
543 * constructor. | |
544 */ | |
545 static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new Compi
leTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', 35, ""); | |
546 /** | |
547 * 5 Variables: It is a compile-time error if a library, static or local varia
ble <i>v</i> is | |
548 * final and <i>v</i> is not initialized at its point of declaration. | |
549 */ | |
550 static final CompileTimeErrorCode FINAL_NOT_INITIALIZED = new CompileTimeError
Code('FINAL_NOT_INITIALIZED', 36, ""); | |
551 /** | |
552 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same | |
553 * name. | |
554 */ | |
555 static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new Compi
leTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', 37, ""); | |
556 /** | |
557 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o
f a class includes | |
558 * type dynamic. | |
559 */ | |
560 static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCod
e('IMPLEMENTS_DYNAMIC', 38, ""); | |
561 /** | |
562 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o
f a class <i>C</i> | |
563 * includes a type expression that does not denote a class available in the le
xical scope of | |
564 * <i>C</i>. | |
565 */ | |
566 static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorC
ode('IMPLEMENTS_NON_CLASS', 39, ""); | |
567 /** | |
568 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
more than once in | |
569 * the implements clause of a class. | |
570 */ | |
571 static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCo
de('IMPLEMENTS_REPEATED', 40, ""); | |
572 /** | |
573 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a | |
574 * superinterface of itself. | |
575 */ | |
576 static final CompileTimeErrorCode IMPLEMENTS_SELF = new CompileTimeErrorCode('
IMPLEMENTS_SELF', 41, ""); | |
577 /** | |
578 * 14.1 Imports: It is a compile-time error to import two different libraries
with the same name. | |
579 */ | |
580 static final CompileTimeErrorCode IMPORT_DUPLICATED_LIBRARY_NAME = new Compile
TimeErrorCode('IMPORT_DUPLICATED_LIBRARY_NAME', 42, ""); | |
581 /** | |
582 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is | |
583 * not a library declaration. | |
584 */ | |
585 static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeError
Code('IMPORT_OF_NON_LIBRARY', 43, ""); | |
586 /** | |
587 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s
ub>k</sub></i> are | |
588 * not instances of the same class <i>C</i>, for all <i>1 <= k <= n</i>. | |
589 */ | |
590 static final CompileTimeErrorCode INCONSITENT_CASE_EXPRESSION_TYPES = new Comp
ileTimeErrorCode('INCONSITENT_CASE_EXPRESSION_TYPES', 44, ""); | |
591 /** | |
592 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a | |
593 * compile-time error if <i>id</i> is not the name of an instance variable of
the immediately | |
594 * enclosing class. | |
595 */ | |
596 static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new Com
pileTimeErrorCode('INITIALIZER_FOR_NON_EXISTANT_FIELD', 45, ""); | |
597 /** | |
598 * 7.6 Constructors: It is a compile-time error if the name of a constructor i
s not a constructor | |
599 * name. | |
600 */ | |
601 static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeEr
rorCode('INVALID_CONSTRUCTOR_NAME', 46, ""); | |
602 /** | |
603 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
the immediately | |
604 * enclosing class. | |
605 */ | |
606 static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new Compi
leTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', 47, ""); | |
607 /** | |
608 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | |
609 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for | |
610 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value | |
611 * for <i>p</i>. | |
612 */ | |
613 static final CompileTimeErrorCode INVALID_OVERRIDE_DEFAULT_VALUE = new Compile
TimeErrorCode('INVALID_OVERRIDE_DEFAULT_VALUE', 48, ""); | |
614 /** | |
615 * 7.1: It is a compile-time error if an instance method <i>m1</i> overrides a
n instance member | |
616 * <i>m2</i> and <i>m1</i> does not declare all the named parameters declared
by <i>m2</i>. | |
617 */ | |
618 static final CompileTimeErrorCode INVALID_OVERRIDE_NAMED = new CompileTimeErro
rCode('INVALID_OVERRIDE_NAMED', 49, ""); | |
619 /** | |
620 * 7.1 Instance Methods: It is a compile-time error if an instance method m1 o
verrides an instance | |
621 * member <i>m2</i> and <i>m1</i> has fewer optional positional parameters tha
n <i>m2</i>. | |
622 */ | |
623 static final CompileTimeErrorCode INVALID_OVERRIDE_POSITIONAL = new CompileTim
eErrorCode('INVALID_OVERRIDE_POSITIONAL', 50, ""); | |
624 /** | |
625 * 7.1 Instance Methods: It is a compile-time error if an instance method <i>m
1</i> overrides an | |
626 * instance member <i>m2</i> and <i>m1</i> has a different number of required
parameters than | |
627 * <i>m2</i>. | |
628 */ | |
629 static final CompileTimeErrorCode INVALID_OVERRIDE_REQUIRED = new CompileTimeE
rrorCode('INVALID_OVERRIDE_REQUIRED', 51, ""); | |
630 /** | |
631 * 12.10 This: It is a compile-time error if this appears in a top-level funct
ion or variable | |
632 * initializer, in a factory constructor, or in a static method or variable in
itializer, or in the | |
633 * initializer of an instance variable. | |
634 */ | |
635 static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeE
rrorCode('INVALID_REFERENCE_TO_THIS', 52, ""); | |
636 /** | |
637 * 12.7 Maps: It is a compile-time error if the first type argument to a map l
iteral is not | |
638 * String. | |
639 */ | |
640 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_FOR_KEY = new CompileT
imeErrorCode('INVALID_TYPE_ARGUMENT_FOR_KEY', 53, ""); | |
641 /** | |
642 * 12.6 Lists: It is a compile time error if the type argument of a constant l
ist literal includes | |
643 * a type parameter. | |
644 */ | |
645 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new Co
mpileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 54, ""); | |
646 /** | |
647 * 12.7 Maps: It is a compile time error if the type arguments of a constant m
ap literal include a | |
648 * type parameter. | |
649 */ | |
650 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new Com
pileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 55, ""); | |
651 /** | |
652 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time | |
653 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is not an | |
654 * instance variable declared in the immediately surrounding class. | |
655 */ | |
656 static final CompileTimeErrorCode INVALID_VARIABLE_IN_INITIALIZER = new Compil
eTimeErrorCode('INVALID_VARIABLE_IN_INITIALIZER', 56, ""); | |
657 /** | |
658 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su
b></i> exists within | |
659 * the innermost function in which <i>s<sub>b</sub></i> occurs. | |
660 * <p> | |
661 * 13.14 Continue: It is a compile-time error if no such statement or case cla
use | |
662 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub
>c</sub></i> occurs. | |
663 * @param labelName the name of the unresolvable label | |
664 */ | |
665 static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorC
ode('LABEL_IN_OUTER_SCOPE', 57, "Cannot reference label '%s' declared in an oute
r method or function"); | |
666 /** | |
667 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su
b></i> exists within | |
668 * the innermost function in which <i>s<sub>b</sub></i> occurs. | |
669 * <p> | |
670 * 13.14 Continue: It is a compile-time error if no such statement or case cla
use | |
671 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub
>c</sub></i> occurs. | |
672 * @param labelName the name of the unresolvable label | |
673 */ | |
674 static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode('
LABEL_UNDEFINED', 58, "Cannot reference undefined label '%s'"); | |
675 /** | |
676 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
with the same name | |
677 * as <i>C</i>. | |
678 */ | |
679 static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErro
rCode('MEMBER_WITH_CLASS_NAME', 59, ""); | |
680 /** | |
681 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici
tly declares a | |
682 * constructor. | |
683 */ | |
684 static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTime
ErrorCode('MIXIN_DECLARES_CONSTRUCTOR', 60, ""); | |
685 /** | |
686 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who
se superclass is not | |
687 * Object. | |
688 */ | |
689 static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new Compile
TimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', 61, ""); | |
690 /** | |
691 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno
te a class or mixin | |
692 * available in the immediately enclosing scope. | |
693 */ | |
694 static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCod
e('MIXIN_OF_NON_CLASS', 62, ""); | |
695 /** | |
696 * 9.1 Mixin Application: If <i>M</i> is a class, it is a compile time error i
f a well formed | |
697 * mixin cannot be derived from <i>M</i>. | |
698 */ | |
699 static final CompileTimeErrorCode MIXIN_OF_NON_MIXIN = new CompileTimeErrorCod
e('MIXIN_OF_NON_MIXIN', 63, ""); | |
700 /** | |
701 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
to super. | |
702 */ | |
703 static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErro
rCode('MIXIN_REFERENCES_SUPER', 64, ""); | |
704 /** | |
705 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno
te a class available | |
706 * in the immediately enclosing scope. | |
707 */ | |
708 static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new Compil
eTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', 65, ""); | |
709 /** | |
710 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th
en <i>k</i> may | |
711 * include at most one superinitializer in its initializer list or a compile t
ime error occurs. | |
712 */ | |
713 static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTim
eErrorCode('MULTIPLE_SUPER_INITIALIZERS', 66, ""); | |
714 /** | |
715 * 12.11.1 New: It is a compile time error if <i>S</i> is not a generic type w
ith <i>m</i> type | |
716 * parameters. | |
717 * @param typeName the name of the type being referenced (<i>S</i>) | |
718 * @param argumentCount the number of type arguments provided | |
719 * @param parameterCount the number of type parameters that were declared | |
720 */ | |
721 static final CompileTimeErrorCode NEW_WITH_INVALID_TYPE_PARAMETERS = new Compi
leTimeErrorCode('NEW_WITH_INVALID_TYPE_PARAMETERS', 67, "The type '%s' is declar
ed with %d type parameters, but %d type arguments were given"); | |
722 /** | |
723 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma
p literal that has | |
724 * no explicit type arguments appears in a place where a statement is expected
. | |
725 */ | |
726 static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new
CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 68, ""); | |
727 /** | |
728 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub
>11</sub> … | |
729 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1
</sub> … | |
730 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s
ub>}</i> or the form | |
731 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub>
1</sub>: | |
732 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case
e<sub>n</sub>: | |
733 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>
k</sub></i> are not | |
734 * compile-time constants, for all <i>1 <= k <= n</i>. | |
735 */ | |
736 static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTi
meErrorCode('NON_CONSTANT_CASE_EXPRESSION', 69, ""); | |
737 /** | |
738 * 6.2.2 Optional Formals: It is a compile-time error if the default value of
an optional | |
739 * parameter is not a compile-time constant. | |
740 */ | |
741 static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTime
ErrorCode('NON_CONSTANT_DEFAULT_VALUE', 70, ""); | |
742 /** | |
743 * 12.6 Lists: It is a compile time error if an element of a constant list lit
eral is not a | |
744 * compile-time constant. | |
745 */ | |
746 static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeE
rrorCode('NON_CONSTANT_LIST_ELEMENT', 71, ""); | |
747 /** | |
748 * 12.7 Maps: It is a compile time error if either a key or a value of an entr
y in a constant map | |
749 * literal is not a compile-time constant. | |
750 */ | |
751 static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorC
ode('NON_CONSTANT_MAP_KEY', 72, ""); | |
752 /** | |
753 * 12.7 Maps: It is a compile time error if either a key or a value of an entr
y in a constant map | |
754 * literal is not a compile-time constant. | |
755 */ | |
756 static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErro
rCode('NON_CONSTANT_MAP_VALUE', 73, ""); | |
757 /** | |
758 * 7.6.3 Constant Constructors: Any expression that appears within the initial
izer list of a | |
759 * constant constructor must be a potentially constant expression, or a compil
e-time error occurs. | |
760 */ | |
761 static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new Comp
ileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', 74, ""); | |
762 /** | |
763 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f
or class Object. | |
764 */ | |
765 static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new Com
pileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 75, ""); | |
766 /** | |
767 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete
r in an operator. | |
768 */ | |
769 static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new Compile
TimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', 76, ""); | |
770 /** | |
771 * 8 Interfaces: It is a compile-time error if an interface member <i>m1</i> o
verrides an | |
772 * interface member <i>m2</i> and <i>m1</i> does not declare all the named par
ameters declared by | |
773 * <i>m2</i> in the same order. | |
774 */ | |
775 static final CompileTimeErrorCode OVERRIDE_MISSING_NAMED_PARAMETERS = new Comp
ileTimeErrorCode('OVERRIDE_MISSING_NAMED_PARAMETERS', 77, ""); | |
776 /** | |
777 * 8 Interfaces: It is a compile-time error if an interface member <i>m1</i> o
verrides an | |
778 * interface member <i>m2</i> and <i>m1</i> has a different number of required
parameters than | |
779 * <i>m2</i>. | |
780 */ | |
781 static final CompileTimeErrorCode OVERRIDE_MISSING_REQUIRED_PARAMETERS = new C
ompileTimeErrorCode('OVERRIDE_MISSING_REQUIRED_PARAMETERS', 78, ""); | |
782 /** | |
783 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part | |
784 * declaration. | |
785 */ | |
786 static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode(
'PART_OF_NON_PART', 79, ""); | |
787 /** | |
788 * 14.1 Imports: It is a compile-time error if the current library declares a
top-level member | |
789 * named <i>p</i>. | |
790 */ | |
791 static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new
CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 80, ""); | |
792 /** | |
793 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o
ptional parameter | |
794 * begins with an ‘_’ character. | |
795 */ | |
796 static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTime
ErrorCode('PRIVATE_OPTIONAL_PARAMETER', 81, ""); | |
797 /** | |
798 * 12.1 Constants: It is a compile-time error if the value of a compile-time c
onstant expression | |
799 * depends on itself. | |
800 */ | |
801 static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new Compil
eTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', 82, ""); | |
802 /** | |
803 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr
uctor redirects to | |
804 * itself, either directly or indirectly via a sequence of redirections. | |
805 */ | |
806 static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTime
ErrorCode('RECURSIVE_FACTORY_REDIRECT', 83, ""); | |
807 /** | |
808 * 15.3.1 Typedef: It is a compile-time error if a typedef refers to itself vi
a a chain of | |
809 * references that does not include a class type. | |
810 */ | |
811 static final CompileTimeErrorCode RECURSIVE_FUNCTION_TYPE_ALIAS = new CompileT
imeErrorCode('RECURSIVE_FUNCTION_TYPE_ALIAS', 84, ""); | |
812 /** | |
813 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. | |
814 */ | |
815 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new Compil
eTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', 85, ""); | |
816 /** | |
817 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th
e const modifier but | |
818 * <i>k’</i> is not a constant constructor. | |
819 */ | |
820 static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new Comp
ileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 86, ""); | |
821 /** | |
822 * 13.3 Local Variable Declaration: It is a compile-time error if <i>e</i> ref
ers to the name | |
823 * <i>v</i> or the name <i>v=</i>. | |
824 */ | |
825 static final CompileTimeErrorCode REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZE
R = new CompileTimeErrorCode('REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER', 87
, ""); | |
826 /** | |
827 * 16.1.1 Reserved Words: A reserved word may not be used as an identifier; it
is a compile-time | |
828 * error if a reserved word is used where an identifier is expected. | |
829 */ | |
830 static final CompileTimeErrorCode RESERVED_WORD_AS_IDENTIFIER = new CompileTim
eErrorCode('RESERVED_WORD_AS_IDENTIFIER', 88, ""); | |
831 /** | |
832 * 13.11 Return: It is a compile-time error if a return statement of the form
<i>return e;</i> | |
833 * appears in a generative constructor. | |
834 */ | |
835 static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new Compi
leTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', 89, ""); | |
836 /** | |
837 * 6.1 Function Declarations: It is a compile-time error to preface a function
declaration with | |
838 * the built-in identifier static. | |
839 */ | |
840 static final CompileTimeErrorCode STATIC_TOP_LEVEL_FUNCTION = new CompileTimeE
rrorCode('STATIC_TOP_LEVEL_FUNCTION', 90, ""); | |
841 /** | |
842 * 5 Variables: It is a compile-time error to preface a top level variable dec
laration with the | |
843 * built-in identifier static. | |
844 */ | |
845 static final CompileTimeErrorCode STATIC_TOP_LEVEL_VARIABLE = new CompileTimeE
rrorCode('STATIC_TOP_LEVEL_VARIABLE', 91, ""); | |
846 /** | |
847 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | |
848 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … | |
849 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe
r method invocation | |
850 * occurs in a top-level function or variable initializer, in an instance vari
able initializer or | |
851 * initializer list, in class Object, in a factory constructor, or in a static
method or variable | |
852 * initializer. | |
853 */ | |
854 static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeEr
rorCode('SUPER_IN_INVALID_CONTEXT', 92, ""); | |
855 /** | |
856 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time | |
857 * error if a generative constructor of class Object includes a superinitializ
er. | |
858 */ | |
859 static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTim
eErrorCode('SUPER_INITIALIZER_IN_OBJECT', 93, ""); | |
860 /** | |
861 * 12.8 Throw: It is a compile-time error if an expression of the form throw;
is not enclosed | |
862 * within a on-catch clause. | |
863 */ | |
864 static final CompileTimeErrorCode THROW_WITHOUT_VALUE_OUTSIDE_ON = new Compile
TimeErrorCode('THROW_WITHOUT_VALUE_OUTSIDE_ON', 94, ""); | |
865 /** | |
866 * 12.11 Instance Creation: It is a compile-time error if a constructor of a n
on-generic type | |
867 * invoked by a new expression or a constant object expression is passed any t
ype arguments. | |
868 * <p> | |
869 * 12.32 Type Cast: It is a compile-time error if <i>T</i> is a parameterized
type of the form | |
870 * <i>G<T<sub>1</sub>, …, T<sub>n</sub>></i> and <i>G</i> is not
a generic type with | |
871 * <i>n</i> type parameters. | |
872 */ | |
873 static final CompileTimeErrorCode TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS = new C
ompileTimeErrorCode('TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS', 95, ""); | |
874 /** | |
875 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears | |
876 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is | |
877 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> | |
878 * (respectively <i>S.id</i>) | |
879 */ | |
880 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new C
ompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 96, ""); | |
881 /** | |
882 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Ea
ch final instance | |
883 * variable <i>f</i> declared in the immediately enclosing class must have an
initializer in | |
884 * <i>k</i>'s initializer list unless it has already been initialized by one o
f the following | |
885 * means: | |
886 * <ol> | |
887 * <li>Initialization at the declaration of <i>f</i>. | |
888 * <li>Initialization by means of an initializing formal of <i>k</i>. | |
889 * </ol> | |
890 * or a compile-time error occurs. | |
891 */ | |
892 static final CompileTimeErrorCode UNINITIALIZED_FINAL_FIELD = new CompileTimeE
rrorCode('UNINITIALIZED_FINAL_FIELD', 97, ""); | |
893 /** | |
894 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
constant, or if | |
895 * <i>x</i> involves string interpolation. | |
896 * <p> | |
897 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co
nstant, or if | |
898 * <i>s</i> involves string interpolation. | |
899 * <p> | |
900 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d
escribes a URI is | |
901 * not a compile-time constant, or if <i>x</i> involves string interpolation. | |
902 */ | |
903 static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErro
rCode('URI_WITH_INTERPOLATION', 98, "URIs cannot use string interpolation"); | |
904 /** | |
905 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar
ed operator []= is | |
906 * not 2. It is a compile time error if the arity of a user-declared operator
with one of the | |
907 * names: <, >, <=, >=, ==, +, /, ~/, *, %, |, ^, &, <<, >
;>, [] is not 1. | |
908 * It is a compile time error if the arity of the user-declared operator - is
not 0 or 1. It is a | |
909 * compile time error if the arity of the user-declared operator ~ is not 0. | |
910 */ | |
911 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = ne
w CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 99, ""); | |
912 /** | |
913 * 7.3 Setters: It is a compile-time error if a setter’s formal parameter li
st does not include | |
914 * exactly one required formal parameter <i>p</i>. | |
915 */ | |
916 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new
CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 100, ""); | |
917 /** | |
918 * 12.11 Instance Creation: It is a compile-time error if a constructor of a g
eneric type with | |
919 * <i>n</i> type parameters invoked by a new expression or a constant object e
xpression is passed | |
920 * <i>m</i> type arguments where <i>m != n</i>. | |
921 * <p> | |
922 * 12.31 Type Test: It is a compile-time error if <i>T</i> is a parameterized
type of the form | |
923 * <i>G<T<sub>1</sub>, …, T<sub>n</sub>></i> and <i>G</i> is not
a generic type with | |
924 * <i>n</i> type parameters. | |
925 */ | |
926 static final CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new Compile
TimeErrorCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 101, ""); | |
927 static final List<CompileTimeErrorCode> values = [AMBIGUOUS_EXPORT, AMBIGUOUS_
IMPORT, ARGUMENT_DEFINITION_TEST_NON_PARAMETER, BUILT_IN_IDENTIFIER_AS_TYPE, BUI
LT_IN_IDENTIFIER_AS_TYPE_NAME, BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, BUILT_IN_IDE
NTIFIER_AS_TYPE_VARIABLE_NAME, CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, COMPILE_T
IME_CONSTANT_RAISES_EXCEPTION, COMPILE_TIME_CONSTANT_RAISES_EXCEPTION_DIVIDE_BY_
ZERO, CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, CONFLICTING_CONSTRUCTOR_NAME_AND_M
ETHOD, CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, CONST_FORMAL_PARAMETER, CONST_INI
TIALIZED_WITH_NON_CONSTANT_VALUE, CONST_EVAL_THROWS_EXCEPTION, CONST_WITH_INVALI
D_TYPE_PARAMETERS, CONST_WITH_NON_CONST, CONST_WITH_NON_CONSTANT_ARGUMENT, CONST
_WITH_NON_TYPE, CONST_WITH_TYPE_PARAMETERS, CONST_WITH_UNDEFINED_CONSTRUCTOR, DE
FAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, DUPLICATE_DEFINITION, DUPLICATE_MEMBER_NAME,
DUPLICATE_MEMBER_NAME_INSTANCE_STATIC, DUPLICATE_NAMED_ARGUMENT, EXPORT_OF_NON_
LIBRARY, EXTENDS_NON_CLASS, EXTENDS_OR_IMPLEMENTS_DISALLOWED_CLASS, FIELD_INITIA
LIZED_BY_MULTIPLE_INITIALIZERS, FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
, FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, FIELD_INITIALIZER_OUTSIDE_CONS
TRUCTOR, FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, FINAL_INITIALIZED_MUL
TIPLE_TIMES, FINAL_NOT_INITIALIZED, GETTER_AND_METHOD_WITH_SAME_NAME, IMPLEMENTS
_DYNAMIC, IMPLEMENTS_NON_CLASS, IMPLEMENTS_REPEATED, IMPLEMENTS_SELF, IMPORT_DUP
LICATED_LIBRARY_NAME, IMPORT_OF_NON_LIBRARY, INCONSITENT_CASE_EXPRESSION_TYPES,
INITIALIZER_FOR_NON_EXISTANT_FIELD, INVALID_CONSTRUCTOR_NAME, INVALID_FACTORY_NA
ME_NOT_A_CLASS, INVALID_OVERRIDE_DEFAULT_VALUE, INVALID_OVERRIDE_NAMED, INVALID_
OVERRIDE_POSITIONAL, INVALID_OVERRIDE_REQUIRED, INVALID_REFERENCE_TO_THIS, INVAL
ID_TYPE_ARGUMENT_FOR_KEY, INVALID_TYPE_ARGUMENT_IN_CONST_LIST, INVALID_TYPE_ARGU
MENT_IN_CONST_MAP, INVALID_VARIABLE_IN_INITIALIZER, LABEL_IN_OUTER_SCOPE, LABEL_
UNDEFINED, MEMBER_WITH_CLASS_NAME, MIXIN_DECLARES_CONSTRUCTOR, MIXIN_INHERITS_FR
OM_NOT_OBJECT, MIXIN_OF_NON_CLASS, MIXIN_OF_NON_MIXIN, MIXIN_REFERENCES_SUPER, M
IXIN_WITH_NON_CLASS_SUPERCLASS, MULTIPLE_SUPER_INITIALIZERS, NEW_WITH_INVALID_TY
PE_PARAMETERS, NON_CONST_MAP_AS_EXPRESSION_STATEMENT, NON_CONSTANT_CASE_EXPRESSI
ON, NON_CONSTANT_DEFAULT_VALUE, NON_CONSTANT_LIST_ELEMENT, NON_CONSTANT_MAP_KEY,
NON_CONSTANT_MAP_VALUE, NON_CONSTANT_VALUE_IN_INITIALIZER, OBJECT_CANNOT_EXTEND
_ANOTHER_CLASS, OPTIONAL_PARAMETER_IN_OPERATOR, OVERRIDE_MISSING_NAMED_PARAMETER
S, OVERRIDE_MISSING_REQUIRED_PARAMETERS, PART_OF_NON_PART, PREFIX_COLLIDES_WITH_
TOP_LEVEL_MEMBER, PRIVATE_OPTIONAL_PARAMETER, RECURSIVE_COMPILE_TIME_CONSTANT, R
ECURSIVE_FACTORY_REDIRECT, RECURSIVE_FUNCTION_TYPE_ALIAS, RECURSIVE_INTERFACE_IN
HERITANCE, REDIRECT_TO_NON_CONST_CONSTRUCTOR, REFERENCE_TO_DECLARED_VARIABLE_IN_
INITIALIZER, RESERVED_WORD_AS_IDENTIFIER, RETURN_IN_GENERATIVE_CONSTRUCTOR, STAT
IC_TOP_LEVEL_FUNCTION, STATIC_TOP_LEVEL_VARIABLE, SUPER_IN_INVALID_CONTEXT, SUPE
R_INITIALIZER_IN_OBJECT, THROW_WITHOUT_VALUE_OUTSIDE_ON, TYPE_ARGUMENTS_FOR_NON_
GENERIC_CLASS, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, UNINITIALIZED_FINAL_FIELD,
URI_WITH_INTERPOLATION, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, WRONG_NUMBER_OF
_PARAMETERS_FOR_SETTER, WRONG_NUMBER_OF_TYPE_ARGUMENTS]; | |
928 final String __name; | |
929 final int __ordinal; | |
930 int get ordinal => __ordinal; | |
931 /** | |
932 * The message template used to create the message to be displayed for this er
ror. | |
933 */ | |
934 String _message; | |
935 /** | |
936 * Initialize a newly created error code to have the given message. | |
937 * @param message the message template used to create the message to be displa
yed for the error | |
938 */ | |
939 CompileTimeErrorCode(this.__name, this.__ordinal, String message) { | |
940 this._message = message; | |
941 } | |
942 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; | |
943 String get message => _message; | |
944 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; | |
945 bool needsRecompilation() => true; | |
946 String toString() => __name; | |
947 } | |
948 /** | |
949 * The enumeration {@code StaticWarningCode} defines the error codes used for st
atic warnings. The | |
950 * convention for this class is for the name of the error code to indicate the p
roblem that caused | |
951 * the error to be generated and for the error message to explain what is wrong
and, when | |
952 * appropriate, how the problem can be corrected. | |
953 * @coverage dart.engine.error | |
954 */ | |
955 class StaticWarningCode implements ErrorCode { | |
956 /** | |
957 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
1 <= i <= n+ | |
958 * k</i> may not be assigned to the type of the corresponding formal parameter
of the constructor | |
959 * <i>T.id</i> (respectively <i>T</i>). | |
960 * <p> | |
961 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub
>, 1 <= i <= | |
962 * n+ k</i> may not be assigned to the type of the corresponding formal parame
ter of the | |
963 * constructor <i>T.id</i> (respectively <i>T</i>). | |
964 * <p> | |
965 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | |
966 * <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 <= | |
967 * 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>. | |
968 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | |
969 * j <= m</i>. | |
970 * <p> | |
971 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 &
lt;= i <= l</i>, | |
972 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, &
hellip; | |
973 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if | |
974 * <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>, | |
975 * 1 <= j <= l</i>. | |
976 */ | |
977 static final StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new StaticWarnin
gCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', 0, ""); | |
978 /** | |
979 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
a NoSuchMethodError | |
980 * to be thrown, because no setter is defined for it. The assignment will also
give rise to a | |
981 * static warning for the same reason. | |
982 */ | |
983 static final StaticWarningCode ASSIGNMENT_TO_FINAL = new StaticWarningCode('AS
SIGNMENT_TO_FINAL', 1, ""); | |
984 /** | |
985 * 13.9 Switch: It is a static warning if the last statement of the statement
sequence | |
986 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. | |
987 */ | |
988 static final StaticWarningCode CASE_BLOCK_NOT_TERMINATED = new StaticWarningCo
de('CASE_BLOCK_NOT_TERMINATED', 2, ""); | |
989 /** | |
990 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
available in the | |
991 * current lexical scope. | |
992 */ | |
993 static final StaticWarningCode CAST_TO_NON_TYPE = new StaticWarningCode('CAST_
TO_NON_TYPE', 3, ""); | |
994 /** | |
995 * 16.1.2 Comments: A token of the form <i>[new c](uri)</i> will be replaced b
y a link in the | |
996 * formatted output. The link will point at the constructor named <i>c</i> in
<i>L</i>. The title | |
997 * of the link will be <i>c</i>. It is a static warning if uri is not the URI
of a dart library | |
998 * <i>L</i>, or if <i>c</i> is not the name of a constructor of a class declar
ed in the exported | |
999 * namespace of <i>L</i>. | |
1000 */ | |
1001 static final StaticWarningCode COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE = new
StaticWarningCode('COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE', 4, ""); | |
1002 /** | |
1003 * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a
link in the | |
1004 * formatted output. The link will point at the declaration named <i>id</i> in
<i>L</i>. The title | |
1005 * of the link will be <i>id</i>. It is a static warning if uri is not the URI
of a dart library | |
1006 * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace
of <i>L</i>. | |
1007 */ | |
1008 static final StaticWarningCode COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE = new
StaticWarningCode('COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE', 5, ""); | |
1009 /** | |
1010 * 16.1.2 Comments: It is a static warning if <i>c</i> does not denote a const
ructor that | |
1011 * available in the scope of the documentation comment. | |
1012 */ | |
1013 static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR = new
StaticWarningCode('COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR', 6, ""); | |
1014 /** | |
1015 * 16.1.2 Comments: It is a static warning if <i>id</i> does not denote a decl
aration that | |
1016 * available in the scope of the documentation comment. | |
1017 */ | |
1018 static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_IDENTIFIER = new S
taticWarningCode('COMMENT_REFERENCE_UNDECLARED_IDENTIFIER', 7, ""); | |
1019 /** | |
1020 * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a
link in the | |
1021 * formatted output. The link will point at the declaration named <i>id</i> in
<i>L</i>. The title | |
1022 * of the link will be <i>id</i>. It is a static warning if uri is not the URI
of a dart library | |
1023 * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace
of <i>L</i>. | |
1024 */ | |
1025 static final StaticWarningCode COMMENT_REFERENCE_URI_NOT_LIBRARY = new StaticW
arningCode('COMMENT_REFERENCE_URI_NOT_LIBRARY', 8, ""); | |
1026 /** | |
1027 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | |
1028 * inherited in a concrete class. | |
1029 */ | |
1030 static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new Stati
cWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 9, ""); | |
1031 /** | |
1032 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc
e getter named | |
1033 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec
lared in a | |
1034 * superclass of <i>C</i>. | |
1035 */ | |
1036 static final StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER',
10, ""); | |
1037 /** | |
1038 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc
e setter named | |
1039 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de
clared in a | |
1040 * superclass of <i>C</i>. | |
1041 */ | |
1042 static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER',
11, ""); | |
1043 /** | |
1044 * 7.2 Getters: It is a static warning if a class declares a static getter nam
ed <i>v</i> and also | |
1045 * has a non-static setter named <i>v=</i>. | |
1046 */ | |
1047 static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
new StaticWarningCode('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 12, ""); | |
1048 /** | |
1049 * 7.3 Setters: It is a static warning if a class declares a static setter nam
ed <i>v=</i> and | |
1050 * also has a non-static member named <i>v</i>. | |
1051 */ | |
1052 static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_GETTER =
new StaticWarningCode('CONFLICTING_STATIC_SETTER_AND_INSTANCE_GETTER', 13, ""); | |
1053 /** | |
1054 * 12.11.2 Const: Given an instance creation expression of the form <i>const q
(a<sub>1</sub>, | |
1055 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const
ructor of an | |
1056 * abstract class but <i>q</i> is not a factory constructor. | |
1057 */ | |
1058 static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCo
de('CONST_WITH_ABSTRACT_CLASS', 14, ""); | |
1059 /** | |
1060 * 12.7 Maps: It is a static warning if the values of any two keys in a map li
teral are equal. | |
1061 */ | |
1062 static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode('EQUA
L_KEYS_IN_MAP', 15, ""); | |
1063 /** | |
1064 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a | |
1065 * static warning if the static type of <i>id</i> is not assignable to <i>T<su
b>id</sub></i>. | |
1066 */ | |
1067 static final StaticWarningCode FIELD_INITIALIZER_WITH_INVALID_TYPE = new Stati
cWarningCode('FIELD_INITIALIZER_WITH_INVALID_TYPE', 16, ""); | |
1068 /** | |
1069 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > | |
1070 * n</i>. | |
1071 */ | |
1072 static final StaticWarningCode INCORRECT_NUMBER_OF_ARGUMENTS = new StaticWarni
ngCode('INCORRECT_NUMBER_OF_ARGUMENTS', 17, ""); | |
1073 /** | |
1074 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a
n instance method | |
1075 * named <i>n</i> and an accessible static member named <i>n</i> is declared i
n a superclass of | |
1076 * <i>C</i>. | |
1077 */ | |
1078 static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S
TATIC = new StaticWarningCode('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STA
TIC', 18, ""); | |
1079 /** | |
1080 * 7.6.2 Factories: It is a static warning if <i>M.id</i> is not a constructor
name. | |
1081 */ | |
1082 static final StaticWarningCode INVALID_FACTORY_NAME = new StaticWarningCode('I
NVALID_FACTORY_NAME', 19, ""); | |
1083 /** | |
1084 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette
r <i>m2</i> and the | |
1085 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | |
1086 */ | |
1087 static final StaticWarningCode INVALID_OVERRIDE_GETTER_TYPE = new StaticWarnin
gCode('INVALID_OVERRIDE_GETTER_TYPE', 20, ""); | |
1088 /** | |
1089 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | |
1090 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | |
1091 */ | |
1092 static final StaticWarningCode INVALID_OVERRIDE_RETURN_TYPE = new StaticWarnin
gCode('INVALID_OVERRIDE_RETURN_TYPE', 21, ""); | |
1093 /** | |
1094 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette
r <i>m2</i> and the | |
1095 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | |
1096 */ | |
1097 static final StaticWarningCode INVALID_OVERRIDE_SETTER_RETURN_TYPE = new Stati
cWarningCode('INVALID_OVERRIDE_SETTER_RETURN_TYPE', 22, ""); | |
1098 /** | |
1099 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | |
1100 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … | |
1101 * 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 | |
1102 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. | |
1103 */ | |
1104 static final StaticWarningCode INVOCATION_OF_NON_FUNCTION = new StaticWarningC
ode('INVOCATION_OF_NON_FUNCTION', 23, ""); | |
1105 /** | |
1106 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type | |
1107 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be | |
1108 * assigned to <i>S</i>. | |
1109 */ | |
1110 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new Static
WarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', 24, ""); | |
1111 /** | |
1112 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst
ract class and | |
1113 * <i>q</i> is not a factory constructor. | |
1114 */ | |
1115 static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode
('NEW_WITH_ABSTRACT_CLASS', 25, ""); | |
1116 /** | |
1117 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i
n the current scope, | |
1118 * optionally followed by type arguments. | |
1119 */ | |
1120 static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode('NEW_
WITH_NON_TYPE', 26, ""); | |
1121 /** | |
1122 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: | |
1123 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, | |
1124 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | |
1125 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. | |
1126 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: | |
1127 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the | |
1128 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. | |
1129 */ | |
1130 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarn
ingCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', 27, ""); | |
1131 /** | |
1132 * 7.10 Superinterfaces: It is a static warning if the implicit interface of a
non-abstract class | |
1133 * <i>C</i> includes an instance member <i>m</i> and <i>C</i> does not declare
or inherit a | |
1134 * corresponding instance member <i>m</i>. | |
1135 */ | |
1136 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER = n
ew StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', 28, ""); | |
1137 /** | |
1138 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | |
1139 * abstract method. | |
1140 */ | |
1141 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD = n
ew StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD', 29, ""); | |
1142 /** | |
1143 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the | |
1144 * current lexical scope. | |
1145 */ | |
1146 static final StaticWarningCode NON_TYPE = new StaticWarningCode('NON_TYPE', 30
, ""); | |
1147 /** | |
1148 * 13.10 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<s
ub>2</sub>) s</i> or | |
1149 * <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 | |
1150 * is a static warning if <i>T</i> does not denote a type available in the lex
ical scope of the | |
1151 * catch clause. | |
1152 */ | |
1153 static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCod
e('NON_TYPE_IN_CATCH_CLAUSE', 31, ""); | |
1154 /** | |
1155 * 7.1.1 Operators: It is a static warning if the return type of the user-decl
ared operator []= is | |
1156 * explicitly declared and not void. | |
1157 */ | |
1158 static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarnin
gCode('NON_VOID_RETURN_FOR_OPERATOR', 32, ""); | |
1159 /** | |
1160 * 7.3 Setters: It is a static warning if a setter declares a return type othe
r than void. | |
1161 */ | |
1162 static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningC
ode('NON_VOID_RETURN_FOR_SETTER', 33, ""); | |
1163 /** | |
1164 * 8 Interfaces: It is a static warning if an interface member <i>m1</i> overr
ides an interface | |
1165 * member <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
<i>m2</i>. | |
1166 */ | |
1167 static final StaticWarningCode OVERRIDE_NOT_SUBTYPE = new StaticWarningCode('O
VERRIDE_NOT_SUBTYPE', 34, ""); | |
1168 /** | |
1169 * 8 Interfaces: It is a static warning if an interface method <i>m1</i> overr
ides an interface | |
1170 * method <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default
value for a formal | |
1171 * parameter <i>p</i> and the signature of <i>m1</i> specifies a different def
ault value for | |
1172 * <i>p</i>. | |
1173 */ | |
1174 static final StaticWarningCode OVERRIDE_WITH_DIFFERENT_DEFAULT = new StaticWar
ningCode('OVERRIDE_WITH_DIFFERENT_DEFAULT', 35, ""); | |
1175 /** | |
1176 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p<
/i> names a library | |
1177 * other than the current library as the library to which <i>p</i> belongs. | |
1178 * @param expectedLibraryName the name of expected library name | |
1179 * @param actualLibraryName the non-matching actual library name from the "par
t of" declaration | |
1180 */ | |
1181 static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCo
de('PART_OF_DIFFERENT_LIBRARY', 36, "Expected this library to be part of '%s', n
ot '%s'"); | |
1182 /** | |
1183 * 7.6.2 Factories: It is a static warning if the function type of <i>k’</i>
is not a subtype of | |
1184 * the type of <i>k</i>. | |
1185 */ | |
1186 static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWar
ningCode('REDIRECT_TO_INVALID_RETURN_TYPE', 37, ""); | |
1187 /** | |
1188 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the | |
1189 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the | |
1190 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. | |
1191 */ | |
1192 static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWar
ningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', 38, ""); | |
1193 /** | |
1194 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the | |
1195 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the | |
1196 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. | |
1197 */ | |
1198 static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode('
REDIRECT_TO_NON_CLASS', 39, ""); | |
1199 /** | |
1200 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form | |
1201 * <i>return;</i> It is a static warning if both of the following conditions h
old: | |
1202 * <ol> | |
1203 * <li><i>f</i> is not a generative constructor. | |
1204 * <li>The return type of <i>f</i> may not be assigned to void. | |
1205 * </ol> | |
1206 */ | |
1207 static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode('R
ETURN_WITHOUT_VALUE', 40, ""); | |
1208 /** | |
1209 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of | |
1210 * <i>e<sub>k</sub></i>. | |
1211 */ | |
1212 static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWa
rningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 41, ""); | |
1213 /** | |
1214 * 12.15.3 Static Invocation: A static method invocation <i>i</i> has the form | |
1215 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … | |
1216 * 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 | |
1217 * class in the current scope. | |
1218 */ | |
1219 static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFI
NED_CLASS', 42, ""); | |
1220 /** | |
1221 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</
i> in the enclosing | |
1222 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e
xplicitly, a getter | |
1223 * named <i>m</i>. | |
1224 */ | |
1225 static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEF
INED_GETTER', 43, ""); | |
1226 /** | |
1227 * 12.30 Identifier Reference: It is as static warning if an identifier expres
sion of the form | |
1228 * <i>id</i> occurs inside a top level or static function (be it function, met
hod, getter, or | |
1229 * setter) or variable initializer and there is no declaration <i>d</i> with n
ame <i>id</i> in the | |
1230 * lexical scope enclosing the expression. | |
1231 */ | |
1232 static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('U
NDEFINED_IDENTIFIER', 44, ""); | |
1233 /** | |
1234 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v
= e</i> occurs | |
1235 * inside a top level or static function (be it function, method, getter, or s
etter) or variable | |
1236 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the
lexical scope | |
1237 * enclosing the assignment. | |
1238 * <p> | |
1239 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t
he enclosing lexical | |
1240 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter | |
1241 * <i>v=</i>. | |
1242 */ | |
1243 static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEF
INED_SETTER', 45, ""); | |
1244 /** | |
1245 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | |
1246 * or getter <i>m</i>. | |
1247 */ | |
1248 static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticW
arningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 46, ""); | |
1249 static final List<StaticWarningCode> values = [ARGUMENT_TYPE_NOT_ASSIGNABLE, A
SSIGNMENT_TO_FINAL, CASE_BLOCK_NOT_TERMINATED, CAST_TO_NON_TYPE, COMMENT_REFEREN
CE_CONSTRUCTOR_NOT_VISIBLE, COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, COMMENT_RE
FERENCE_UNDECLARED_CONSTRUCTOR, COMMENT_REFERENCE_UNDECLARED_IDENTIFIER, COMMENT
_REFERENCE_URI_NOT_LIBRARY, CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, CONFLICTING_INS
TANCE_GETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_M
EMBER, CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, CONFLICTING_STATIC_SETTER_
AND_INSTANCE_GETTER, CONST_WITH_ABSTRACT_CLASS, EQUAL_KEYS_IN_MAP, FIELD_INITIAL
IZER_WITH_INVALID_TYPE, INCORRECT_NUMBER_OF_ARGUMENTS, INSTANCE_METHOD_NAME_COLL
IDES_WITH_SUPERCLASS_STATIC, INVALID_FACTORY_NAME, INVALID_OVERRIDE_GETTER_TYPE,
INVALID_OVERRIDE_RETURN_TYPE, INVALID_OVERRIDE_SETTER_RETURN_TYPE, INVOCATION_O
F_NON_FUNCTION, MISMATCHED_GETTER_AND_SETTER_TYPES, NEW_WITH_ABSTRACT_CLASS, NEW
_WITH_NON_TYPE, NEW_WITH_UNDEFINED_CONSTRUCTOR, NON_ABSTRACT_CLASS_INHERITS_ABST
RACT_MEMBER, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD, NON_TYPE, NON_TYPE_IN_
CATCH_CLAUSE, NON_VOID_RETURN_FOR_OPERATOR, NON_VOID_RETURN_FOR_SETTER, OVERRIDE
_NOT_SUBTYPE, OVERRIDE_WITH_DIFFERENT_DEFAULT, PART_OF_DIFFERENT_LIBRARY, REDIRE
CT_TO_INVALID_RETURN_TYPE, REDIRECT_TO_MISSING_CONSTRUCTOR, REDIRECT_TO_NON_CLAS
S, RETURN_WITHOUT_VALUE, SWITCH_EXPRESSION_NOT_ASSIGNABLE, UNDEFINED_CLASS, UNDE
FINED_GETTER, UNDEFINED_IDENTIFIER, UNDEFINED_SETTER, UNDEFINED_STATIC_METHOD_OR
_GETTER]; | |
1250 final String __name; | |
1251 final int __ordinal; | |
1252 int get ordinal => __ordinal; | |
1253 /** | |
1254 * The message template used to create the message to be displayed for this er
ror. | |
1255 */ | |
1256 String _message; | |
1257 /** | |
1258 * Initialize a newly created error code to have the given type and message. | |
1259 * @param message the message template used to create the message to be displa
yed for the error | |
1260 */ | |
1261 StaticWarningCode(this.__name, this.__ordinal, String message) { | |
1262 this._message = message; | |
1263 } | |
1264 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; | |
1265 String get message => _message; | |
1266 ErrorType get type => ErrorType.STATIC_WARNING; | |
1267 bool needsRecompilation() => true; | |
1268 String toString() => __name; | |
1269 } | |
1270 /** | |
1271 * The interface {@code AnalysisErrorListener} defines the behavior of objects t
hat listen for{@link AnalysisError analysis errors} being produced by the analys
is engine. | |
1272 * @coverage dart.engine.error | |
1273 */ | |
1274 abstract class AnalysisErrorListener { | |
1275 /** | |
1276 * This method is invoked when an error has been found by the analysis engine. | |
1277 * @param error the error that was just found (not {@code null}) | |
1278 */ | |
1279 void onError(AnalysisError error); | |
1280 } | |
1281 /** | |
1282 * The enumeration {@code StaticTypeWarningCode} defines the error codes used fo
r static type | |
1283 * warnings. The convention for this class is for the name of the error code to
indicate the problem | |
1284 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | |
1285 * when appropriate, how the problem can be corrected. | |
1286 * @coverage dart.engine.error | |
1287 */ | |
1288 class StaticTypeWarningCode implements ErrorCode { | |
1289 /** | |
1290 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | |
1291 * warning if <i>T</i> does not have an accessible instance setter named <i>v=
</i>. | |
1292 * @see #UNDEFINED_SETTER | |
1293 */ | |
1294 static final StaticTypeWarningCode INACCESSIBLE_SETTER = new StaticTypeWarning
Code('INACCESSIBLE_SETTER', 0, ""); | |
1295 /** | |
1296 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, | |
1297 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because | |
1298 * identically named members existed in several superinterfaces) then at most
one member is | |
1299 * inherited. If the static types <i>T<sub>1</sub>, …, T<sub>k</sub></i
> of the members | |
1300 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> are not identical, then there
must be a member | |
1301 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> < T<sub>i</sub>, 1 <=
x <= k</i> for | |
1302 * all <i>i, 1 <= i < k</i>, or a static type warning occurs. The member
that is inherited | |
1303 * is <i>m<sub>x</sub></i>, if it exists; otherwise: | |
1304 * <ol> | |
1305 * <li>If all of <i>m<sub>1</sub>, … m<sub>k</sub></i> have the same nu
mber <i>r</i> of | |
1306 * required parameters and the same set of named parameters <i>s</i>, then let
<i>h = max( | |
1307 * numberOfOptionalPositionals( m<sub>i</sub> ) ), 1 <= i <= k</i>. <i>I
</i> has a method | |
1308 * named <i>n</i>, with <i>r</i> required parameters of type dynamic, <i>h</i>
optional positional | |
1309 * parameters of type dynamic, named parameters <i>s</i> of type dynamic and r
eturn type dynamic. | |
1310 * <li>Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub>
</i> is inherited. | |
1311 * </ol> | |
1312 */ | |
1313 static final StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = new Stati
cTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', 1, ""); | |
1314 /** | |
1315 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i
> may not be | |
1316 * assigned to the static type of <i>v</i>. The static type of the expression
<i>v = e</i> is the | |
1317 * static type of <i>e</i>. | |
1318 * <p> | |
1319 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i
> may not be | |
1320 * assigned to the static type of <i>C.v</i>. The static type of the expressio
n <i>C.v = e</i> is | |
1321 * the static type of <i>e</i>. | |
1322 * <p> | |
1323 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | |
1324 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <
i>T</i>. | |
1325 * @param lhsTypeName the name of the left hand side type | |
1326 * @param rhsTypeName the name of the right hand side type | |
1327 */ | |
1328 static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningC
ode('INVALID_ASSIGNMENT', 2, "The type '%s' can't be assigned a '%s'"); | |
1329 /** | |
1330 * 12.14.4 Function Expression Invocation: A function expression invocation <i
>i</i> has the form | |
1331 * <i>e<sub>f</sub>(a<sub>1</sub>, … a<sub>n</sub>, x<sub>n+1</sub>: a<
sub>n+1</sub>, | |
1332 * …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i>
is an expression. | |
1333 * <p> | |
1334 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub>
</i> may not be | |
1335 * assigned to a function type. | |
1336 * <p> | |
1337 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
form | |
1338 * <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … | |
1339 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. | |
1340 * <p> | |
1341 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if
<i>T</i> does not | |
1342 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it
is a static warning | |
1343 * 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 | |
1344 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</
i> is dynamic. | |
1345 * <p> | |
1346 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i>
of <i>C.m</i> may | |
1347 * not be assigned to a function type. | |
1348 * @param nonFunctionIdentifier the name of the identifier that is not a funct
ion type | |
1349 */ | |
1350 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = new StaticType
WarningCode('INVOCATION_OF_NON_FUNCTION', 3, "'%s' is not a method or function")
; | |
1351 /** | |
1352 * 12.19 Conditional: It is a static type warning if the type of <i>e<sub>1</s
ub></i> may not be | |
1353 * assigned to bool. | |
1354 * <p> | |
1355 * 13.5 If: It is a static type warning if the type of the expression <i>b</i>
may not be assigned | |
1356 * to bool. | |
1357 * <p> | |
1358 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be
assigned to bool. | |
1359 * <p> | |
1360 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi
gned to bool. | |
1361 */ | |
1362 static final StaticTypeWarningCode NON_BOOL_CONDITION = new StaticTypeWarningC
ode('NON_BOOL_CONDITION', 4, "Conditions must have a static type of 'bool'"); | |
1363 /** | |
1364 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b
e assigned to either | |
1365 * bool or () → bool | |
1366 */ | |
1367 static final StaticTypeWarningCode NON_BOOL_EXPRESSION = new StaticTypeWarning
Code('NON_BOOL_EXPRESSION', 5, "Assertions must be on either a 'bool' or '() ->
bool'"); | |
1368 /** | |
1369 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
1 <= i <= | |
1370 * n</i> does not denote a type in the enclosing lexical scope. | |
1371 */ | |
1372 static final StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = new StaticTypeW
arningCode('NON_TYPE_AS_TYPE_ARGUMENT', 6, ""); | |
1373 /** | |
1374 * 7.6.2 Factories: It is a static type warning if any of the type arguments t
o <i>k’</i> are not | |
1375 * subtypes of the bounds of the corresponding formal type parameters of type. | |
1376 */ | |
1377 static final StaticTypeWarningCode REDIRECT_WITH_INVALID_TYPE_PARAMETERS = new
StaticTypeWarningCode('REDIRECT_WITH_INVALID_TYPE_PARAMETERS', 7, ""); | |
1378 /** | |
1379 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b
e assigned to the | |
1380 * declared return type of the immediately enclosing function. | |
1381 */ | |
1382 static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarn
ingCode('RETURN_OF_INVALID_TYPE', 8, "The return type '%s' is not a '%s', as def
ined by the method"); | |
1383 /** | |
1384 * 12.11 Instance Creation: It is a static type warning if any of the type arg
uments to a | |
1385 * constructor of a generic type <i>G</i> invoked by a new expression or a con
stant object | |
1386 * expression are not subtypes of the bounds of the corresponding formal type
parameters of | |
1387 * <i>G</i>. | |
1388 * @param boundedTypeName the name of the type used in the instance creation t
hat should be | |
1389 * limited by the bound as specified in the class declaration | |
1390 * @param boundingTypeName the name of the bounding type | |
1391 */ | |
1392 static final StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Sta
ticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 9, "'%s' does not extend
'%s'"); | |
1393 /** | |
1394 * 10 Generics: It is a static type warning if a type parameter is a supertype
of its upper bound. | |
1395 * <p> | |
1396 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</
i> of <i>G</i>, then | |
1397 * the static type of the member <i>m</i> of <i>G<A<sub>1</sub>, … A
<sub>n</sub>></i> | |
1398 * is <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1</sub>, …, T<su
b>n</sub>]S</i> | |
1399 * where <i>T<sub>1</sub>, … T<sub>n</sub></i> are the formal type para
meters of <i>G</i>. | |
1400 * Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 <= i <=
n</i>. It is a | |
1401 * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1
</sub>, …, | |
1402 * A<sub>n</sub>/T<sub>1</sub>, …, T<sub>n</sub>]B<sub>i</sub>, 1 <=
i <= n</i>. | |
1403 */ | |
1404 static final StaticTypeWarningCode TYPE_ARGUMENT_VIOLATES_BOUNDS = new StaticT
ypeWarningCode('TYPE_ARGUMENT_VIOLATES_BOUNDS', 10, ""); | |
1405 /** | |
1406 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
a static type | |
1407 * warning if <i>T</i> does not have a getter named <i>m</i>. | |
1408 */ | |
1409 static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCod
e('UNDEFINED_GETTER', 11, "There is no such getter '%s' in '%s'"); | |
1410 /** | |
1411 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | |
1412 * warning if <i>T</i> does not have an accessible instance setter named <i>v=
</i>. | |
1413 * @see #INACCESSIBLE_SETTER | |
1414 */ | |
1415 static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCod
e('UNDEFINED_SETTER', 12, "There is no such setter '%s' in '%s'"); | |
1416 /** | |
1417 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | |
1418 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … | |
1419 * 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 | |
1420 * accessible instance member named <i>m</i>. | |
1421 * @param methodName the name of the method that is undefined | |
1422 * @param typeName the resolved type name that the method lookup is happening
on | |
1423 */ | |
1424 static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarn
ingCode('UNDEFINED_SUPER_METHOD', 13, "There is no such method '%s' in '%s'"); | |
1425 /** | |
1426 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not an
accessible generic | |
1427 * type declaration with <i>n</i> type parameters. | |
1428 * @param typeName the name of the type being referenced (<i>G</i>) | |
1429 * @param argumentCount the number of type arguments provided | |
1430 * @param parameterCount the number of type parameters that were declared | |
1431 */ | |
1432 static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new Static
TypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 14, "The type '%s' is declared
with %d type parameters, but %d type arguments were given"); | |
1433 static final List<StaticTypeWarningCode> values = [INACCESSIBLE_SETTER, INCONS
ISTENT_METHOD_INHERITANCE, INVALID_ASSIGNMENT, INVOCATION_OF_NON_FUNCTION, NON_B
OOL_CONDITION, NON_BOOL_EXPRESSION, NON_TYPE_AS_TYPE_ARGUMENT, REDIRECT_WITH_INV
ALID_TYPE_PARAMETERS, RETURN_OF_INVALID_TYPE, TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
TYPE_ARGUMENT_VIOLATES_BOUNDS, UNDEFINED_GETTER, UNDEFINED_SETTER, UNDEFINED_SU
PER_METHOD, WRONG_NUMBER_OF_TYPE_ARGUMENTS]; | |
1434 final String __name; | |
1435 final int __ordinal; | |
1436 int get ordinal => __ordinal; | |
1437 /** | |
1438 * The message template used to create the message to be displayed for this er
ror. | |
1439 */ | |
1440 String _message; | |
1441 /** | |
1442 * Initialize a newly created error code to have the given type and message. | |
1443 * @param message the message template used to create the message to be displa
yed for the error | |
1444 */ | |
1445 StaticTypeWarningCode(this.__name, this.__ordinal, String message) { | |
1446 this._message = message; | |
1447 } | |
1448 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; | |
1449 String get message => _message; | |
1450 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; | |
1451 bool needsRecompilation() => true; | |
1452 String toString() => __name; | |
1453 } | |
OLD | NEW |