Index: pkg/compiler/lib/src/diagnostics/messages.dart |
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart |
index 31c7070dbead320300f78db035e3b1ec026b1055..d0aafc536ede7550f144d1d5ec1142bb48d02866 100644 |
--- a/pkg/compiler/lib/src/diagnostics/messages.dart |
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart |
@@ -256,6 +256,8 @@ enum MessageKind { |
INVALID_CONTINUE, |
INVALID_FOR_IN, |
INVALID_INITIALIZER, |
+ INVALID_METADATA, |
+ INVALID_METADATA_GENERIC, |
INVALID_OVERRIDDEN_FIELD, |
INVALID_OVERRIDDEN_GETTER, |
INVALID_OVERRIDDEN_METHOD, |
@@ -2866,6 +2868,31 @@ main() => new C(); |
"The getter '#{name}' is implicitly declared by this field " |
"in class '#{class}'."), |
+ MessageKind.INVALID_METADATA: |
+ const MessageTemplate(MessageKind.INVALID_METADATA, |
+ "A metadata annotation must be either a reference to a compile-time " |
+ "constant variable or a call to a constant constructor.", |
+ howToFix: |
+ "Try using a different constant value or referencing it through a " |
+ "constant variable.", |
+ examples: const [ |
+'@Object main() {}', |
+'@print main() {}']), |
+ |
+ MessageKind.INVALID_METADATA_GENERIC: |
+ const MessageTemplate(MessageKind.INVALID_METADATA_GENERIC, |
+ "A metadata annotation using a constant constructor cannot use type " |
+ "arguments.", |
+ howToFix: |
+ "Try removing the type arguments or referencing the constant " |
+ "through a constant variable.", |
+ examples: const [''' |
+class C<T> { |
+ const C(); |
+} |
+@C<int>() main() {} |
+''']), |
+ |
MessageKind.EQUAL_MAP_ENTRY_KEY: |
const MessageTemplate(MessageKind.EQUAL_MAP_ENTRY_KEY, |
"An entry with the same key already exists in the map.", |