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

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

Issue 1048463002: Issue 22279. Tweak constants evaluation error messages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library engine.error; 5 library engine.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'ast.dart' show AstNode; 9 import 'ast.dart' show AstNode;
10 import 'element.dart'; 10 import 'element.dart';
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = 697 static const CompileTimeErrorCode CONST_NOT_INITIALIZED =
698 const CompileTimeErrorCode('CONST_NOT_INITIALIZED', 698 const CompileTimeErrorCode('CONST_NOT_INITIALIZED',
699 "The const variable '{0}' must be initialized"); 699 "The const variable '{0}' must be initialized");
700 700
701 /** 701 /**
702 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, 702 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
703 * where e, e1 and e2 are constant expressions that evaluate to a boolean 703 * where e, e1 and e2 are constant expressions that evaluate to a boolean
704 * value. 704 * value.
705 */ 705 */
706 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = 706 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL =
707 const CompileTimeErrorCode( 707 const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL',
708 'CONST_EVAL_TYPE_BOOL', "An expression of type 'bool' was expected"); 708 "In constant expressions operand(s) of this operator must be of type ' bool'");
Brian Wilkerson 2015/03/28 02:35:33 I'd change "expressions" --> "expressions," but ot
scheglov 2015/03/28 03:09:15 Done.
709 709
710 /** 710 /**
711 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where 711 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
712 * e1 and e2 are constant expressions that evaluate to a numeric, string or 712 * e1 and e2 are constant expressions that evaluate to a numeric, string or
713 * boolean value or to null. 713 * boolean value or to null.
714 */ 714 */
715 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = 715 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING =
716 const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING', 716 const CompileTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING',
717 "An expression of type 'bool', 'num', 'String' or 'null' was expected" ); 717 "In constant expressions operands of this operator must be of type 'bo ol', 'num', 'String' or 'null'");
718 718
719 /** 719 /**
720 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, 720 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2,
721 * e1 | e2, e1 >> e2 or e1 << e2, where e, e1 and e2 are constant expressions 721 * e1 | e2, e1 >> e2 or e1 << e2, where e, e1 and e2 are constant expressions
722 * that evaluate to an integer value or to null. 722 * that evaluate to an integer value or to null.
723 */ 723 */
724 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = 724 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT =
725 const CompileTimeErrorCode( 725 const CompileTimeErrorCode('CONST_EVAL_TYPE_INT',
726 'CONST_EVAL_TYPE_INT', "An expression of type 'int' was expected"); 726 "In constant expressions operand(s) of this operator must be of type ' int'");
727 727
728 /** 728 /**
729 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * 729 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
730 * e2, e1 / e2, e1 ~/ e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, 730 * e2, e1 / e2, e1 ~/ e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2,
731 * where e, e1 and e2 are constant expressions that evaluate to a numeric 731 * where e, e1 and e2 are constant expressions that evaluate to a numeric
732 * value or to null. 732 * value or to null.
733 */ 733 */
734 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = 734 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM =
735 const CompileTimeErrorCode( 735 const CompileTimeErrorCode('CONST_EVAL_TYPE_NUM',
736 'CONST_EVAL_TYPE_NUM', "An expression of type 'num' was expected"); 736 "In constant expressions operand(s) of this operator must be of type ' num'");
737 737
738 /** 738 /**
739 * 12.11.2 Const: It is a compile-time error if evaluation of a constant 739 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
740 * object results in an uncaught exception being thrown. 740 * object results in an uncaught exception being thrown.
741 */ 741 */
742 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = 742 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION =
743 const CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION', 743 const CompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION',
744 "Evaluation of this constant expression causes exception"); 744 "Evaluation of this constant expression causes exception");
745 745
746 /** 746 /**
(...skipping 4135 matching lines...) Expand 10 before | Expand all | Expand 10 after
4882 * Initialize a newly created error code to have the given [name]. 4882 * Initialize a newly created error code to have the given [name].
4883 */ 4883 */
4884 const TodoCode(String name) : super(name, "{0}"); 4884 const TodoCode(String name) : super(name, "{0}");
4885 4885
4886 @override 4886 @override
4887 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 4887 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
4888 4888
4889 @override 4889 @override
4890 ErrorType get type => ErrorType.TODO; 4890 ErrorType get type => ErrorType.TODO;
4891 } 4891 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698