Chromium Code Reviews| 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> … label<sub>n1</sub> … 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 <= k <= 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. |
| */ |