OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // An update to this file must be followed by regenerating the corresponding | 5 // An update to this file must be followed by regenerating the corresponding |
6 // json, dart2js and analyzer file. Use `publish.dart` in the bin directory. | 6 // json, dart2js and analyzer file. Use `publish.dart` in the bin directory. |
7 // | 7 // |
8 // Every message in this file must have an id. Use `message_id.dart` in the | 8 // Every message in this file must have an id. Use `message_id.dart` in the |
9 // bin directory to generate a fresh one. | 9 // bin directory to generate a fresh one. |
10 | 10 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 examples: const ["class A { class B {} } main() { new A(); }",]), | 397 examples: const ["class A { class B {} } main() { new A(); }",]), |
398 | 398 |
399 'CONSTRUCTOR_WITH_RETURN_TYPE': new Message( | 399 'CONSTRUCTOR_WITH_RETURN_TYPE': new Message( |
400 id: 'VOJBWY', | 400 id: 'VOJBWY', |
401 category: Category.parserError, | 401 category: Category.parserError, |
402 template: "Constructors can't have a return type", | 402 template: "Constructors can't have a return type", |
403 howToFix: "Try removing the return type.", | 403 howToFix: "Try removing the return type.", |
404 usedBy: [analyzer, dart2js], | 404 usedBy: [analyzer, dart2js], |
405 examples: const ["class A { int A() {} } main() { new A(); }",]), | 405 examples: const ["class A { int A() {} } main() { new A(); }",]), |
406 | 406 |
407 'MISSING_EXPRESSION_IN_THROW': new Message( | |
408 id: 'FTGGMJ', | |
409 subId: 0, | |
410 category: Category.parserError, | |
411 template: "Throw expressions must compute the object to be thrown.", | |
Siggi Cherem (dart-lang)
2016/02/18 21:04:13
nit: in this case I prefer the old message we used
floitsch
2016/02/18 21:12:18
Going with "Missing expression after 'throw'."
Per
| |
412 howToFix: "Did you mean 'rethrow'?", | |
413 usedBy: [ | |
414 analyzer, | |
415 dart2js | |
416 ], | |
417 examples: const [ | |
418 'main() { throw; }', | |
419 'main() { try { throw 0; } catch(e) { throw; } }' | |
420 ]), | |
421 | |
422 /** | |
423 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form | |
424 * <i>rethrow;</i> is not enclosed within a on-catch clause. | |
425 */ | |
426 'RETHROW_OUTSIDE_CATCH': new Message( | |
427 id: 'MWETLC', | |
428 category: Category.compileTimeError, | |
429 template: 'Rethrow must be inside of catch clause', | |
430 howToFix: "Try moving the expression into a catch clause, or " | |
431 "using a 'throw' expression.", | |
432 usedBy: [analyzer, dart2js], | |
433 examples: const ["main() { rethrow; }"]), | |
434 | |
407 /** | 435 /** |
408 * 13.12 Return: It is a compile-time error if a return statement of the form | 436 * 13.12 Return: It is a compile-time error if a return statement of the form |
409 * <i>return e;</i> appears in a generative constructor. | 437 * <i>return e;</i> appears in a generative constructor. |
410 */ | 438 */ |
411 'RETURN_IN_GENERATIVE_CONSTRUCTOR': new Message( | 439 'RETURN_IN_GENERATIVE_CONSTRUCTOR': new Message( |
412 id: 'UOTDQH', | 440 id: 'UOTDQH', |
413 category: Category.compileTimeError, | 441 category: Category.compileTimeError, |
414 template: "Constructors can't return values.", | 442 template: "Constructors can't return values.", |
415 howToFix: | 443 howToFix: |
416 "Try removing the return statement or using a factory constructor.", | 444 "Try removing the return statement or using a factory constructor.", |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
449 """ | 477 """ |
450 foo() async* { return 0; } | 478 foo() async* { return 0; } |
451 main() => foo(); | 479 main() => foo(); |
452 """, | 480 """, |
453 """ | 481 """ |
454 foo() sync* { return 0; } | 482 foo() sync* { return 0; } |
455 main() => foo(); | 483 main() => foo(); |
456 """ | 484 """ |
457 ]), | 485 ]), |
458 }; | 486 }; |
OLD | NEW |