| 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 m(T t) => const C<T>(); | 1214 m(T t) => const C<T>(); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 void main() => new C().m(null); | 1217 void main() => new C().m(null); |
| 1218 """ | 1218 """ |
| 1219 ]), | 1219 ]), |
| 1220 | 1220 |
| 1221 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate( | 1221 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate( |
| 1222 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED, | 1222 MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED, |
| 1223 "Method type variables do not have a runtime value.", | 1223 "Method type variables do not have a runtime value.", |
| 1224 options: const ["--generic-method-syntax"], |
| 1224 howToFix: "Try using the upper bound of the type variable, " | 1225 howToFix: "Try using the upper bound of the type variable, " |
| 1225 "or refactor the code to avoid needing this runtime value.", | 1226 "or refactor the code to avoid needing this runtime value.", |
| 1226 examples: const [ | 1227 examples: const [ |
| 1227 """ | 1228 """ |
| 1228 // Method type variables are not reified, so they cannot be returned. | 1229 // Method type variables are not reified, so they cannot be returned. |
| 1229 Type f<T>() => T; | 1230 Type f<T>() => T; |
| 1230 | 1231 |
| 1231 main() => f<int>(); | 1232 main() => f<int>(); |
| 1232 """, | 1233 """, |
| 1233 """ | 1234 """ |
| 1234 // Method type variables are not reified, so they cannot be tested dynamically. | 1235 // Method type variables are not reified, so they cannot be tested dynamically. |
| 1235 bool f<T>(Object o) => o is T; | 1236 bool f<T>(Object o) => o is T; |
| 1236 | 1237 |
| 1237 main() => f<int>(42); | 1238 main() => f<int>(42); |
| 1238 """ | 1239 """ |
| 1239 ]), | 1240 ]), |
| 1240 | 1241 |
| 1241 MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC: | 1242 MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC: |
| 1242 const MessageTemplate( | 1243 const MessageTemplate( |
| 1243 MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC, | 1244 MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC, |
| 1244 "Method type variables are treated as `dynamic` in `as` expressions.", | 1245 "Method type variables are treated as `dynamic` in `as` expressions.", |
| 1246 options: const ["--generic-method-syntax"], |
| 1245 howToFix: "Try using the upper bound of the type variable, or check " | 1247 howToFix: "Try using the upper bound of the type variable, or check " |
| 1246 "that the blind success of the test does not introduce bugs.", | 1248 "that the blind success of the test does not introduce bugs.", |
| 1247 examples: const [ | 1249 examples: const [ |
| 1248 """ | 1250 """ |
| 1249 // Method type variables are not reified, so they cannot be tested dynamically. | 1251 // Method type variables are not reified, so they cannot be tested dynamically. |
| 1250 bool f<T>(Object o) => o as T; | 1252 bool f<T>(Object o) => o as T; |
| 1251 | 1253 |
| 1252 main() => f<int>(42); | 1254 main() => f<int>(42); |
| 1253 """ | 1255 """ |
| 1254 ]), | 1256 ]), |
| (...skipping 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3827 static String convertToString(value) { | 3829 static String convertToString(value) { |
| 3828 if (value is ErrorToken) { | 3830 if (value is ErrorToken) { |
| 3829 // Shouldn't happen. | 3831 // Shouldn't happen. |
| 3830 return value.assertionMessage; | 3832 return value.assertionMessage; |
| 3831 } else if (value is Token) { | 3833 } else if (value is Token) { |
| 3832 value = value.value; | 3834 value = value.value; |
| 3833 } | 3835 } |
| 3834 return '$value'; | 3836 return '$value'; |
| 3835 } | 3837 } |
| 3836 } | 3838 } |
| OLD | NEW |