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

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

Issue 18010002: Report errors for invalid annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bd51ddb0f1ea4ef9be200ba5f91fd9d1f90d2590..1a5dcd7dc60b8f884c80ad15738e9655e04d4323 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
@@ -597,6 +597,13 @@ public enum CompileTimeErrorCode implements ErrorCode {
INSTANCE_MEMBER_ACCESS_FROM_STATIC("Instance member cannot be accessed from static method"),
/**
+ * 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.
+ */
+ INVALID_ANNOTATION("Annotation can be only constant variable or constant constructor invocation"),
+
+ /**
* 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.
*/
@@ -804,6 +811,13 @@ public enum CompileTimeErrorCode implements ErrorCode {
"The type '%s' is declared with %d type parameters, but %d type arguments were given"),
/**
+ * 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.
+ */
+ NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS("Annotation creation must have arguments"),
+
+ /**
* 7.6.1 Generative Constructors: If no superinitializer is provided, an implicit superinitializer
* of the form <b>super</b>() is added at the end of <i>k</i>'s initializer list, unless the
* enclosing class is class <i>Object</i>.
@@ -865,6 +879,13 @@ public enum CompileTimeErrorCode implements ErrorCode {
NON_CONSTANT_MAP_VALUE("The values in a 'const' map must be constant"),
/**
+ * 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.
+ */
+ NON_CONSTANT_ANNOTATION_CONSTRUCTOR("Annotation creation can use only 'const' constructor"),
+
+ /**
* 7.6.3 Constant Constructors: Any expression that appears within the initializer list of a
* constant constructor must be a potentially constant expression, or a compile-time error occurs.
*/
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698