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

Unified Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 637303005: Type check constant variable declarations. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index a783e7e18e2ccc64feef5a3337cf0fb6ded999ff..aacb26d3c9d6d24433e477236ffd61140dc8eb3b 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -456,12 +456,23 @@ class CheckedModeCompileTimeErrorCode extends Enum<CheckedModeCompileTimeErrorCo
*/
static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 4, "The element type '{0}' cannot be assigned to the map value type '{1}'");
+ /**
+ * 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
+ * uncaught exception being thrown.
+ */
+ static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH =
+ const CheckedModeCompileTimeErrorCode.con1(
+ 'VARIABLE_TYPE_MISMATCH',
+ 5,
+ "The object type '{0}' cannot be assigned to a variable of type '{1}'");
Brian Wilkerson 2014/10/10 21:23:45 "variable" --> "const variable"? It might be more
Paul Berry 2014/10/10 21:56:38 Good point. I've added a TODO comment for now. I
+
static const List<CheckedModeCompileTimeErrorCode> values = const [
CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
MAP_KEY_TYPE_NOT_ASSIGNABLE,
- MAP_VALUE_TYPE_NOT_ASSIGNABLE];
+ MAP_VALUE_TYPE_NOT_ASSIGNABLE,
+ VARIABLE_TYPE_MISMATCH];
/**
* The template used to create the message to be displayed for this error.
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698