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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java

Issue 258393003: Further work on 17522 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
index 417d46860c10eeabf50e7a3671eded882ce10a8f..043e951047f6387384a6402f998a2709c3d6c5b3 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/error/CompileTimeErrorCode.java
@@ -184,6 +184,16 @@ public enum CompileTimeErrorCode implements ErrorCode {
CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE("'const' variables must be constant value"),
/**
+ * 5 Variables: A constant variable must be initialized to a compile-time constant or a
+ * compile-time error occurs.
+ * <p>
+ * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
+ * deferred prefix.
+ */
+ CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY(
+ "'const' variables must be constant value, values from deferred libraries are not evaluated to be constant"),
Brian Wilkerson 2014/04/29 23:01:52 I'm not sure how clear this message will be. How a
jwren 2014/04/30 22:42:14 Done and correct. On 2014/04/29 23:01:52, Brian W
+
+ /**
* 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be
* constant.
*/
@@ -658,6 +668,17 @@ public enum CompileTimeErrorCode implements ErrorCode {
INVALID_ANNOTATION("Annotation can be only constant variable or constant constructor invocation"),
/**
+ * 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
+ * character @, followed by a constant expression that must be either a reference to a
+ * compile-time constant variable, or a call to a constant constructor.
+ * <p>
+ * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
+ * deferred prefix.
+ */
+ INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY(
+ "Annotation can be only constant variable or constant constructor invocation, values from deferred libraries are not evaluated to be constant"),
+
+ /**
* TODO(brianwilkerson) Remove this when we have decided on how to report errors in compile-time
* constants. Until then, this acts as a placeholder for more informative errors.
* <p>
@@ -933,6 +954,10 @@ public enum CompileTimeErrorCode implements ErrorCode {
* s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
* s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>k</sub></i> are not
* compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
+ * <p>
+ * TODO (jwren) For this and all other NON_CONSTANT_* error codes we need a corresponding
+ * NON_CONSTANT_*_FROM_DEFERRED_LIBRARY, see NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY or
+ * CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY.
*/
NON_CONSTANT_CASE_EXPRESSION("Case expressions must be constant"),
@@ -943,6 +968,16 @@ public enum CompileTimeErrorCode implements ErrorCode {
NON_CONSTANT_DEFAULT_VALUE("Default values of an optional parameter must be constant"),
/**
+ * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
+ * parameter is not a compile-time constant.
+ * <p>
+ * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
+ * deferred prefix.
+ */
+ NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY(
+ "Default values of an optional parameter must be constant, values from deferred libraries are not evaluated to be constant"),
+
+ /**
* 12.6 Lists: It is a compile time error if an element of a constant list literal is not a
* compile-time constant.
*/

Powered by Google App Engine
This is Rietveld 408576698