| OLD | NEW |
| 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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 | 1148 |
| 1149 m(T t) => const C<T>(); | 1149 m(T t) => const C<T>(); |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 void main() => new C().m(null); | 1152 void main() => new C().m(null); |
| 1153 """ | 1153 """ |
| 1154 ]), | 1154 ]), |
| 1155 | 1155 |
| 1156 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate( | 1156 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate( |
| 1157 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED, | 1157 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED, |
| 1158 "Method type variables are not reified.", | 1158 "Method type variables do not have a runtime value.", |
| 1159 howToFix: "Try using the intended upper bound of the " | 1159 options: const ["--generic-method-syntax"], |
| 1160 "type variable, or dynamic." | 1160 howToFix: "Try using the upper bound of the type variable, " |
| 1161 // TODO(eernst): These examples should be commented in with an `options:` | 1161 "or refactor the code to avoid needing this runtime value.", |
| 1162 // specifying "--generic-method-syntax" and made to work; moreover, the | 1162 examples: const [ |
| 1163 // compiler/dart2js test 'generic_method_type_usage' should be transformed to | 1163 """ |
| 1164 // similar examples of the relevant `MessageKind` entries. | 1164 // Method type variables are not reified, so they cannot be returned. |
| 1165 // | 1165 Type f<T>() => T; |
| 1166 // examples: const [ | 1166 |
| 1167 // """ | 1167 main() => f<int>(); |
| 1168 // // Method type variables are not reified, so they cannot be returned. | 1168 """, |
| 1169 // Type f<T>() => T; | 1169 """ |
| 1170 // | 1170 // Method type variables are not reified, so they cannot be tested dynamically. |
| 1171 // main() => f<int>(); | 1171 bool f<T>(Object o) => o is T; |
| 1172 // """, | 1172 |
| 1173 // """ | 1173 main() => f<int>(42); |
| 1174 // // Method type variables are not reified, so they cannot be tested dynamicall
y. | 1174 """, |
| 1175 // bool f<T>(Object o) => o is T; | 1175 """ |
| 1176 // | 1176 // Method type variables are not reified, so they cannot be tested dynamically. |
| 1177 // main() => f<int>(42); | 1177 bool f<T>(Object o) => o as T; |
| 1178 // """, | 1178 |
| 1179 // """ | 1179 main() => f<int>(42); |
| 1180 // // Method type variables are not reified, so they cannot be tested dynamicall
y. | 1180 """ |
| 1181 // bool f<T>(Object o) => o as T; | 1181 ]), |
| 1182 // | |
| 1183 // main() => f<int>(42); | |
| 1184 // """ | |
| 1185 // ] | |
| 1186 ), | |
| 1187 | 1182 |
| 1188 MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate( | 1183 MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate( |
| 1189 MessageKind.INVALID_TYPE_VARIABLE_BOUND, | 1184 MessageKind.INVALID_TYPE_VARIABLE_BOUND, |
| 1190 "'#{typeArgument}' is not a subtype of bound '#{bound}' for " | 1185 "'#{typeArgument}' is not a subtype of bound '#{bound}' for " |
| 1191 "type variable '#{typeVariable}' of type '#{thisType}'.", | 1186 "type variable '#{typeVariable}' of type '#{thisType}'.", |
| 1192 howToFix: "Try to change or remove the type argument.", | 1187 howToFix: "Try to change or remove the type argument.", |
| 1193 examples: const [ | 1188 examples: const [ |
| 1194 """ | 1189 """ |
| 1195 class C<T extends num> {} | 1190 class C<T extends num> {} |
| 1196 | 1191 |
| (...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3750 static String convertToString(value) { | 3745 static String convertToString(value) { |
| 3751 if (value is ErrorToken) { | 3746 if (value is ErrorToken) { |
| 3752 // Shouldn't happen. | 3747 // Shouldn't happen. |
| 3753 return value.assertionMessage; | 3748 return value.assertionMessage; |
| 3754 } else if (value is Token) { | 3749 } else if (value is Token) { |
| 3755 value = value.value; | 3750 value = value.value; |
| 3756 } | 3751 } |
| 3757 return '$value'; | 3752 return '$value'; |
| 3758 } | 3753 } |
| 3759 } | 3754 } |
| OLD | NEW |