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

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

Issue 633803002: Check parameter types when evaluating constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.error; 8 library engine.error;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 /** 386 /**
387 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time errors 387 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time errors
388 * caused by constant evaluation that would throw an exception when run in check ed mode. The client 388 * caused by constant evaluation that would throw an exception when run in check ed mode. The client
389 * of the analysis engine is responsible for determining how these errors should be presented to the 389 * of the analysis engine is responsible for determining how these errors should be presented to the
390 * user (for example, a command-line compiler might elect to treat these errors differently 390 * user (for example, a command-line compiler might elect to treat these errors differently
391 * depending whether it is compiling it "checked" mode). 391 * depending whether it is compiling it "checked" mode).
392 */ 392 */
393 class CheckedModeCompileTimeErrorCode extends Enum<CheckedModeCompileTimeErrorCo de> implements ErrorCode { 393 class CheckedModeCompileTimeErrorCode extends Enum<CheckedModeCompileTimeErrorCo de> implements ErrorCode {
394 /** 394 /**
395 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
396 * uncaught exception being thrown.
397 */
398 static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_PARAM_TYPE_MISM ATCH =
399 const CheckedModeCompileTimeErrorCode.con1(
400 'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH',
401 0,
402 "The object type '{0}' cannot be assigned to a parameter of type '{1}' ");
403
404 /**
395 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not 405 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
396 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of 406 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of
397 * the field <i>v</i>. 407 * the field <i>v</i>.
398 * 408 *
399 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 409 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
400 * uncaught exception being thrown. 410 * uncaught exception being thrown.
401 * 411 *
402 * @param initializerType the name of the type of the initializer expression 412 * @param initializerType the name of the type of the initializer expression
403 * @param fieldType the name of the type of the field 413 * @param fieldType the name of the type of the field
404 */ 414 */
405 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE = const CheckedModeCompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ ASSIGNABLE', 0, "The initializer type '{0}' cannot be assigned to the field type '{1}'"); 415 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE = const CheckedModeCompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ ASSIGNABLE', 1, "The initializer type '{0}' cannot be assigned to the field type '{1}'");
406 416
407 /** 417 /**
408 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ... 418 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
409 * <i>e<sub>n</sub></i>] is evaluated as follows: 419 * <i>e<sub>n</sub></i>] is evaluated as follows:
410 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument 420 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
411 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i> 421 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
412 * 422 *
413 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 423 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
414 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 424 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
415 * 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>. 425 * 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>.
416 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 426 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
417 * j &lt;= m</i>. 427 * j &lt;= m</i>.
418 */ 428 */
419 static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 1, "The element type '{0}' cannot be assigned to the list type '{1}'"); 429 static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 2, "The element type '{0}' cannot be assigned to the list type '{1}'");
420 430
421 /** 431 /**
422 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 432 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
423 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 433 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
424 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 434 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
425 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 435 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
426 * 436 *
427 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 437 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
428 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 438 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
429 * 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>. 439 * 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>.
430 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 440 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
431 * j &lt;= m</i>. 441 * j &lt;= m</i>.
432 */ 442 */
433 static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = con st CheckedModeCompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 2, "The e lement type '{0}' cannot be assigned to the map key type '{1}'"); 443 static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = con st CheckedModeCompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 3, "The e lement type '{0}' cannot be assigned to the map key type '{1}'");
434 444
435 /** 445 /**
436 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 446 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
437 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 447 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
438 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 448 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
439 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 449 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
440 * 450 *
441 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 451 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
442 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 452 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
443 * 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>. 453 * 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>.
444 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 454 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
445 * j &lt;= m</i>. 455 * j &lt;= m</i>.
446 */ 456 */
447 static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = c onst CheckedModeCompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 3, "T he element type '{0}' cannot be assigned to the map value type '{1}'"); 457 static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = c onst CheckedModeCompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 4, "T he element type '{0}' cannot be assigned to the map value type '{1}'");
448 458
449 static const List<CheckedModeCompileTimeErrorCode> values = const [ 459 static const List<CheckedModeCompileTimeErrorCode> values = const [
460 CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
450 CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, 461 CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
451 LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 462 LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
452 MAP_KEY_TYPE_NOT_ASSIGNABLE, 463 MAP_KEY_TYPE_NOT_ASSIGNABLE,
453 MAP_VALUE_TYPE_NOT_ASSIGNABLE]; 464 MAP_VALUE_TYPE_NOT_ASSIGNABLE];
454 465
455 /** 466 /**
456 * The template used to create the message to be displayed for this error. 467 * The template used to create the message to be displayed for this error.
457 */ 468 */
458 final String message; 469 final String message;
459 470
(...skipping 3764 matching lines...) Expand 10 before | Expand all | Expand 10 after
4224 4235
4225 @override 4236 @override
4226 String get message => "{0}"; 4237 String get message => "{0}";
4227 4238
4228 @override 4239 @override
4229 ErrorType get type => ErrorType.TODO; 4240 ErrorType get type => ErrorType.TODO;
4230 4241
4231 @override 4242 @override
4232 String get uniqueName => "${runtimeType.toString()}.${name}"; 4243 String get uniqueName => "${runtimeType.toString()}.${name}";
4233 } 4244 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698