| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 const DONT_KNOW_HOW_TO_FIX = ""; | 7 const DONT_KNOW_HOW_TO_FIX = ""; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * The messages in this file should meet the following guide lines: | 10 * The messages in this file should meet the following guide lines: |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 520 |
| 521 static const DualKind TYPE_VARIABLE_WITHIN_STATIC_MEMBER = const DualKind( | 521 static const DualKind TYPE_VARIABLE_WITHIN_STATIC_MEMBER = const DualKind( |
| 522 error: const MessageKind( | 522 error: const MessageKind( |
| 523 "Error: Cannot refer to type variable '#{typeVariableName}' " | 523 "Error: Cannot refer to type variable '#{typeVariableName}' " |
| 524 "within a static member."), | 524 "within a static member."), |
| 525 warning: const MessageKind( | 525 warning: const MessageKind( |
| 526 "Warning: Cannot refer to type variable '#{typeVariableName}' " | 526 "Warning: Cannot refer to type variable '#{typeVariableName}' " |
| 527 "within a static member.")); | 527 "within a static member.")); |
| 528 | 528 |
| 529 static const MessageKind TYPE_VARIABLE_IN_CONSTANT = const MessageKind( | 529 static const MessageKind TYPE_VARIABLE_IN_CONSTANT = const MessageKind( |
| 530 "Error: Cannot refer to type variable in constant."); | 530 "Error: Constant expressions can't refer to type variables.", |
| 531 howToFix: "Try removing the type variable or replacing it with a " |
| 532 "concrete type.", |
| 533 examples: const [""" |
| 534 class C<T> { |
| 535 const C(); |
| 536 |
| 537 m(T t) => const C<T>(); |
| 538 } |
| 539 |
| 540 void main() => new C().m(null); |
| 541 """ |
| 542 ]); |
| 543 |
| 531 | 544 |
| 532 static const MessageKind INVALID_TYPE_VARIABLE_BOUND = const MessageKind( | 545 static const MessageKind INVALID_TYPE_VARIABLE_BOUND = const MessageKind( |
| 533 "Warning: '#{typeArgument}' is not a subtype of bound '#{bound}' for " | 546 "Warning: '#{typeArgument}' is not a subtype of bound '#{bound}' for " |
| 534 "type variable '#{typeVariable}' of type '#{thisType}'.", | 547 "type variable '#{typeVariable}' of type '#{thisType}'.", |
| 535 howToFix: "Try to change or remove the type argument.", | 548 howToFix: "Try to change or remove the type argument.", |
| 536 examples: const [""" | 549 examples: const [""" |
| 537 class C<T extends num> {} | 550 class C<T extends num> {} |
| 538 | 551 |
| 539 // 'String' is not a valid instantiation of T with bound num.'. | 552 // 'String' is not a valid instantiation of T with bound num.'. |
| 540 main() => new C<String>(); | 553 main() => new C<String>(); |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 | 1534 |
| 1522 class CompileTimeConstantError extends Diagnostic { | 1535 class CompileTimeConstantError extends Diagnostic { |
| 1523 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) | 1536 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) |
| 1524 : super(kind, arguments, terse); | 1537 : super(kind, arguments, terse); |
| 1525 } | 1538 } |
| 1526 | 1539 |
| 1527 class CompilationError extends Diagnostic { | 1540 class CompilationError extends Diagnostic { |
| 1528 CompilationError(MessageKind kind, Map arguments, bool terse) | 1541 CompilationError(MessageKind kind, Map arguments, bool terse) |
| 1529 : super(kind, arguments, terse); | 1542 : super(kind, arguments, terse); |
| 1530 } | 1543 } |
| OLD | NEW |