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

Side by Side Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 1510863004: Report compile-time error on disallowed metadata values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * The messages in this file should meet the following guide lines: 7 * The messages in this file should meet the following guide lines:
8 * 8 *
9 * 1. The message should be a complete sentence starting with an uppercase 9 * 1. The message should be a complete sentence starting with an uppercase
10 * letter, and ending with a period. 10 * letter, and ending with a period.
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 INTERNAL_LIBRARY_FROM, 249 INTERNAL_LIBRARY_FROM,
250 INVALID_ARGUMENT_AFTER_NAMED, 250 INVALID_ARGUMENT_AFTER_NAMED,
251 INVALID_AWAIT_FOR, 251 INVALID_AWAIT_FOR,
252 INVALID_BREAK, 252 INVALID_BREAK,
253 INVALID_CASE_DEFAULT, 253 INVALID_CASE_DEFAULT,
254 INVALID_CONSTRUCTOR_ARGUMENTS, 254 INVALID_CONSTRUCTOR_ARGUMENTS,
255 INVALID_CONSTRUCTOR_NAME, 255 INVALID_CONSTRUCTOR_NAME,
256 INVALID_CONTINUE, 256 INVALID_CONTINUE,
257 INVALID_FOR_IN, 257 INVALID_FOR_IN,
258 INVALID_INITIALIZER, 258 INVALID_INITIALIZER,
259 INVALID_METADATA,
260 INVALID_METADATA_GENERIC,
259 INVALID_OVERRIDDEN_FIELD, 261 INVALID_OVERRIDDEN_FIELD,
260 INVALID_OVERRIDDEN_GETTER, 262 INVALID_OVERRIDDEN_GETTER,
261 INVALID_OVERRIDDEN_METHOD, 263 INVALID_OVERRIDDEN_METHOD,
262 INVALID_OVERRIDDEN_SETTER, 264 INVALID_OVERRIDDEN_SETTER,
263 INVALID_OVERRIDE_FIELD, 265 INVALID_OVERRIDE_FIELD,
264 INVALID_OVERRIDE_FIELD_WITH_GETTER, 266 INVALID_OVERRIDE_FIELD_WITH_GETTER,
265 INVALID_OVERRIDE_FIELD_WITH_SETTER, 267 INVALID_OVERRIDE_FIELD_WITH_SETTER,
266 INVALID_OVERRIDE_GETTER, 268 INVALID_OVERRIDE_GETTER,
267 INVALID_OVERRIDE_GETTER_WITH_FIELD, 269 INVALID_OVERRIDE_GETTER_WITH_FIELD,
268 INVALID_OVERRIDE_METHOD, 270 INVALID_OVERRIDE_METHOD,
(...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after
2859 2861
2860 MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER: 2862 MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER:
2861 const MessageTemplate(MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER, 2863 const MessageTemplate(MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
2862 "The getter '#{name}' is declared here in class '#{class}'."), 2864 "The getter '#{name}' is declared here in class '#{class}'."),
2863 2865
2864 MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER: 2866 MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER:
2865 const MessageTemplate(MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER, 2867 const MessageTemplate(MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
2866 "The getter '#{name}' is implicitly declared by this field " 2868 "The getter '#{name}' is implicitly declared by this field "
2867 "in class '#{class}'."), 2869 "in class '#{class}'."),
2868 2870
2871 MessageKind.INVALID_METADATA:
2872 const MessageTemplate(MessageKind.INVALID_METADATA,
2873 "A metadata annotation must be either a reference to a compile-time "
2874 "constant variable or a call to a constant constructor.",
2875 howToFix:
2876 "Try using a different constant value or referencing it through a "
2877 "constant variable.",
2878 examples: const [
2879 '@Object main() {}',
2880 '@print main() {}']),
2881
2882 MessageKind.INVALID_METADATA_GENERIC:
2883 const MessageTemplate(MessageKind.INVALID_METADATA_GENERIC,
2884 "A metadata annotation using a constant constructor cannot use type "
2885 "arguments.",
2886 howToFix:
2887 "Try removing the type arguments or referencing the constant "
2888 "through a constant variable.",
2889 examples: const ['''
2890 class C<T> {
2891 const C();
2892 }
2893 @C<int>() main() {}
2894 ''']),
2895
2869 MessageKind.EQUAL_MAP_ENTRY_KEY: 2896 MessageKind.EQUAL_MAP_ENTRY_KEY:
2870 const MessageTemplate(MessageKind.EQUAL_MAP_ENTRY_KEY, 2897 const MessageTemplate(MessageKind.EQUAL_MAP_ENTRY_KEY,
2871 "An entry with the same key already exists in the map.", 2898 "An entry with the same key already exists in the map.",
2872 howToFix: 2899 howToFix:
2873 "Try removing the previous entry or changing the key in one " 2900 "Try removing the previous entry or changing the key in one "
2874 "of the entries.", 2901 "of the entries.",
2875 examples: const [""" 2902 examples: const ["""
2876 main() { 2903 main() {
2877 var m = const {'foo': 1, 'foo': 2}; 2904 var m = const {'foo': 1, 'foo': 2};
2878 }"""]), 2905 }"""]),
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
3644 static String convertToString(value) { 3671 static String convertToString(value) {
3645 if (value is ErrorToken) { 3672 if (value is ErrorToken) {
3646 // Shouldn't happen. 3673 // Shouldn't happen.
3647 return value.assertionMessage; 3674 return value.assertionMessage;
3648 } else if (value is Token) { 3675 } else if (value is Token) {
3649 value = value.value; 3676 value = value.value;
3650 } 3677 }
3651 return '$value'; 3678 return '$value';
3652 } 3679 }
3653 } 3680 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698