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

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

Issue 2000223002: Revert "Adjusts dart2js backend to handle method type arguments." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/js_backend/backend.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 * The messages in this file should meet the following guide lines: 6 * The messages in this file should meet the following guide lines:
7 * 7 *
8 * 1. The message should be a complete sentence starting with an uppercase 8 * 1. The message should be a complete sentence starting with an uppercase
9 * letter, and ending with a period. 9 * letter, and ending with a period.
10 * 10 *
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 THIS_CALL_TO_FACTORY, 423 THIS_CALL_TO_FACTORY,
424 THIS_IS_THE_DECLARATION, 424 THIS_IS_THE_DECLARATION,
425 THIS_IS_THE_METHOD, 425 THIS_IS_THE_METHOD,
426 THIS_IS_THE_PART_OF_TAG, 426 THIS_IS_THE_PART_OF_TAG,
427 THIS_PROPERTY, 427 THIS_PROPERTY,
428 RETHROW_OUTSIDE_CATCH, 428 RETHROW_OUTSIDE_CATCH,
429 TOP_LEVEL_VARIABLE_DECLARED_STATIC, 429 TOP_LEVEL_VARIABLE_DECLARED_STATIC,
430 TYPE_ARGUMENT_COUNT_MISMATCH, 430 TYPE_ARGUMENT_COUNT_MISMATCH,
431 TYPE_VARIABLE_IN_CONSTANT, 431 TYPE_VARIABLE_IN_CONSTANT,
432 TYPE_VARIABLE_WITHIN_STATIC_MEMBER, 432 TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
433 TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED,
434 TYPEDEF_FORMAL_WITH_DEFAULT, 433 TYPEDEF_FORMAL_WITH_DEFAULT,
435 UNARY_OPERATOR_BAD_ARITY, 434 UNARY_OPERATOR_BAD_ARITY,
436 UNBOUND_LABEL, 435 UNBOUND_LABEL,
437 UNIMPLEMENTED_EXPLICIT_GETTER, 436 UNIMPLEMENTED_EXPLICIT_GETTER,
438 UNIMPLEMENTED_EXPLICIT_SETTER, 437 UNIMPLEMENTED_EXPLICIT_SETTER,
439 UNIMPLEMENTED_GETTER, 438 UNIMPLEMENTED_GETTER,
440 UNIMPLEMENTED_GETTER_ONE, 439 UNIMPLEMENTED_GETTER_ONE,
441 UNIMPLEMENTED_IMPLICIT_GETTER, 440 UNIMPLEMENTED_IMPLICIT_GETTER,
442 UNIMPLEMENTED_IMPLICIT_SETTER, 441 UNIMPLEMENTED_IMPLICIT_SETTER,
443 UNIMPLEMENTED_METHOD, 442 UNIMPLEMENTED_METHOD,
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 class C<T> { 1145 class C<T> {
1147 const C(); 1146 const C();
1148 1147
1149 m(T t) => const C<T>(); 1148 m(T t) => const C<T>();
1150 } 1149 }
1151 1150
1152 void main() => new C().m(null); 1151 void main() => new C().m(null);
1153 """ 1152 """
1154 ]), 1153 ]),
1155 1154
1156 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate(
1157 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED,
1158 "Method type variables are not reified.",
1159 howToFix: "Try using the intended upper bound of the "
1160 "type variable, or dynamic."
1161 // TODO(eernst): These examples should be commented in with an `options:`
1162 // specifying "--generic-method-syntax" and made to work; moreover, the
1163 // compiler/dart2js test 'generic_method_type_usage' should be transformed to
1164 // similar examples of the relevant `MessageKind` entries.
1165 //
1166 // examples: const [
1167 // """
1168 // // Method type variables are not reified, so they cannot be returned.
1169 // Type f<T>() => T;
1170 //
1171 // main() => f<int>();
1172 // """,
1173 // """
1174 // // Method type variables are not reified, so they cannot be tested dynamicall y.
1175 // bool f<T>(Object o) => o is T;
1176 //
1177 // main() => f<int>(42);
1178 // """,
1179 // """
1180 // // Method type variables are not reified, so they cannot be tested dynamicall y.
1181 // bool f<T>(Object o) => o as T;
1182 //
1183 // main() => f<int>(42);
1184 // """
1185 // ]
1186 ),
1187
1188 MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate( 1155 MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate(
1189 MessageKind.INVALID_TYPE_VARIABLE_BOUND, 1156 MessageKind.INVALID_TYPE_VARIABLE_BOUND,
1190 "'#{typeArgument}' is not a subtype of bound '#{bound}' for " 1157 "'#{typeArgument}' is not a subtype of bound '#{bound}' for "
1191 "type variable '#{typeVariable}' of type '#{thisType}'.", 1158 "type variable '#{typeVariable}' of type '#{thisType}'.",
1192 howToFix: "Try to change or remove the type argument.", 1159 howToFix: "Try to change or remove the type argument.",
1193 examples: const [ 1160 examples: const [
1194 """ 1161 """
1195 class C<T extends num> {} 1162 class C<T extends num> {}
1196 1163
1197 // 'String' is not a valid instantiation of T with bound num.'. 1164 // 'String' is not a valid instantiation of T with bound num.'.
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3750 static String convertToString(value) { 3717 static String convertToString(value) {
3751 if (value is ErrorToken) { 3718 if (value is ErrorToken) {
3752 // Shouldn't happen. 3719 // Shouldn't happen.
3753 return value.assertionMessage; 3720 return value.assertionMessage;
3754 } else if (value is Token) { 3721 } else if (value is Token) {
3755 value = value.value; 3722 value = value.value;
3756 } 3723 }
3757 return '$value'; 3724 return '$value';
3758 } 3725 }
3759 } 3726 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698