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

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

Issue 1976213002: Adjusts dart2js backend to handle method type arguments. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Made MethodTypeVariableType malformed, eliminated malformMethodTypeVariableType Created 4 years, 7 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
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,
433 TYPEDEF_FORMAL_WITH_DEFAULT, 434 TYPEDEF_FORMAL_WITH_DEFAULT,
434 UNARY_OPERATOR_BAD_ARITY, 435 UNARY_OPERATOR_BAD_ARITY,
435 UNBOUND_LABEL, 436 UNBOUND_LABEL,
436 UNIMPLEMENTED_EXPLICIT_GETTER, 437 UNIMPLEMENTED_EXPLICIT_GETTER,
437 UNIMPLEMENTED_EXPLICIT_SETTER, 438 UNIMPLEMENTED_EXPLICIT_SETTER,
438 UNIMPLEMENTED_GETTER, 439 UNIMPLEMENTED_GETTER,
439 UNIMPLEMENTED_GETTER_ONE, 440 UNIMPLEMENTED_GETTER_ONE,
440 UNIMPLEMENTED_IMPLICIT_GETTER, 441 UNIMPLEMENTED_IMPLICIT_GETTER,
441 UNIMPLEMENTED_IMPLICIT_SETTER, 442 UNIMPLEMENTED_IMPLICIT_SETTER,
442 UNIMPLEMENTED_METHOD, 443 UNIMPLEMENTED_METHOD,
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 class C<T> { 1146 class C<T> {
1146 const C(); 1147 const C();
1147 1148
1148 m(T t) => const C<T>(); 1149 m(T t) => const C<T>();
1149 } 1150 }
1150 1151
1151 void main() => new C().m(null); 1152 void main() => new C().m(null);
1152 """ 1153 """
1153 ]), 1154 ]),
1154 1155
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."
Johnni Winther 2016/05/23 12:50:41 You can add an [options] argument to MessageTempla
eernst 2016/05/23 14:30:24 Marked as TODOs for the next CL.
1161 // GENERIC_METHODS: These examples can be commented in when the compiler
1162 // supports generic methods without an option:
1163 //
1164 // examples: const [
1165 // """
1166 // // Method type variables are not reified, so they cannot be returned.
1167 // Type f<T>() => T;
1168 //
1169 // main() => f<int>();
1170 // """,
1171 // """
1172 // // Method type variables are not reified, so they cannot be tested dynamicall y.
1173 // bool f<T>(Object o) => o is T;
1174 //
1175 // main() => f<int>(42);
1176 // """,
1177 // """
1178 // // Method type variables are not reified, so they cannot be tested dynamicall y.
1179 // bool f<T>(Object o) => o as T;
1180 //
1181 // main() => f<int>(42);
1182 // """
1183 // ]
1184 ),
1185
1155 MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate( 1186 MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate(
1156 MessageKind.INVALID_TYPE_VARIABLE_BOUND, 1187 MessageKind.INVALID_TYPE_VARIABLE_BOUND,
1157 "'#{typeArgument}' is not a subtype of bound '#{bound}' for " 1188 "'#{typeArgument}' is not a subtype of bound '#{bound}' for "
1158 "type variable '#{typeVariable}' of type '#{thisType}'.", 1189 "type variable '#{typeVariable}' of type '#{thisType}'.",
1159 howToFix: "Try to change or remove the type argument.", 1190 howToFix: "Try to change or remove the type argument.",
1160 examples: const [ 1191 examples: const [
1161 """ 1192 """
1162 class C<T extends num> {} 1193 class C<T extends num> {}
1163 1194
1164 // 'String' is not a valid instantiation of T with bound num.'. 1195 // 'String' is not a valid instantiation of T with bound num.'.
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3717 static String convertToString(value) { 3748 static String convertToString(value) {
3718 if (value is ErrorToken) { 3749 if (value is ErrorToken) {
3719 // Shouldn't happen. 3750 // Shouldn't happen.
3720 return value.assertionMessage; 3751 return value.assertionMessage;
3721 } else if (value is Token) { 3752 } else if (value is Token) {
3722 value = value.value; 3753 value = value.value;
3723 } 3754 }
3724 return '$value'; 3755 return '$value';
3725 } 3756 }
3726 } 3757 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698