| 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 class MessageKind { | 7 class MessageKind { |
| 8 final String template; | 8 final String template; |
| 9 const MessageKind(this.template); | 9 const MessageKind(this.template); |
| 10 | 10 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 "Did you forget a factory keyword here?"); | 405 "Did you forget a factory keyword here?"); |
| 406 | 406 |
| 407 static const DEFERRED_LIBRARY_NAME_MISMATCH = const MessageKind( | 407 static const DEFERRED_LIBRARY_NAME_MISMATCH = const MessageKind( |
| 408 'Error: Library name mismatch "#{expectedName}" != "#{actualName}".'); | 408 'Error: Library name mismatch "#{expectedName}" != "#{actualName}".'); |
| 409 | 409 |
| 410 static const ILLEGAL_STATIC = const MessageKind( | 410 static const ILLEGAL_STATIC = const MessageKind( |
| 411 "Error: Modifier static is only allowed on functions declared in" | 411 "Error: Modifier static is only allowed on functions declared in" |
| 412 " a class."); | 412 " a class."); |
| 413 | 413 |
| 414 static const STATIC_FUNCTION_BLOAT = const MessageKind( | 414 static const STATIC_FUNCTION_BLOAT = const MessageKind( |
| 415 'Warning: Using "#{class}.#{name}" may result in larger output.'); | 415 'Hint: Using "#{class}.#{name}" may result in larger output.'); |
| 416 | 416 |
| 417 static const NON_CONST_BLOAT = const MessageKind(''' | 417 static const NON_CONST_BLOAT = const MessageKind(''' |
| 418 Warning: Using "new #{name}" may result in larger output. | 418 Hint: Using "new #{name}" may result in larger output. |
| 419 Use "const #{name}" if possible.'''); | 419 Use "const #{name}" if possible.'''); |
| 420 | 420 |
| 421 static const STRING_EXPECTED = const MessageKind( | 421 static const STRING_EXPECTED = const MessageKind( |
| 422 'Error: Expected a "String", but got an instance of "#{type}".'); | 422 'Error: Expected a "String", but got an instance of "#{type}".'); |
| 423 | 423 |
| 424 static const PRIVATE_IDENTIFIER = const MessageKind( | 424 static const PRIVATE_IDENTIFIER = const MessageKind( |
| 425 'Error: "#{value}" is not a valid Symbol name because it starts with ' | 425 'Error: "#{value}" is not a valid Symbol name because it starts with ' |
| 426 '"_".'); | 426 '"_".'); |
| 427 | 427 |
| 428 static const INVALID_SYMBOL = const MessageKind(''' | 428 static const INVALID_SYMBOL = const MessageKind(''' |
| 429 Error: "#{value}" is not a valid Symbol name because is not: | 429 Error: "#{value}" is not a valid Symbol name because is not: |
| 430 * an empty String, | 430 * an empty String, |
| 431 * a user defined operator, | 431 * a user defined operator, |
| 432 * a qualified non-private identifier optionally followed by "=", or | 432 * a qualified non-private identifier optionally followed by "=", or |
| 433 * a qualified non-private identifier followed by "." and a user-defined operato
r.'''); | 433 * a qualified non-private identifier followed by "." and a user-defined operato
r.'''); |
| 434 | 434 |
| 435 static const AMBIGUOUS_REEXPORT = const MessageKind( | 435 static const AMBIGUOUS_REEXPORT = const MessageKind( |
| 436 'Info: "#{element}" is (re)exported by multiple libraries.'); | 436 'Info: "#{element}" is (re)exported by multiple libraries.'); |
| 437 | 437 |
| 438 static const AMBIGUOUS_LOCATION = const MessageKind( | 438 static const AMBIGUOUS_LOCATION = const MessageKind( |
| 439 'Info: "#{element}" is defined here.'); | 439 'Info: "#{element}" is defined here.'); |
| 440 | 440 |
| 441 static const IMPORTED_HERE = const MessageKind( | 441 static const IMPORTED_HERE = const MessageKind( |
| 442 'Info: "#{element}" is imported here.'); | 442 'Info: "#{element}" is imported here.'); |
| 443 |
| 444 static const OVERRIDE_EQUALS_NOT_HASH_CODE = const MessageKind( |
| 445 'Hint: The class "#{class}" overrides "operator==", ' |
| 446 'but not "get hashCode".'); |
| 443 | 447 |
| 444 static const COMPILER_CRASHED = const MessageKind( | 448 static const COMPILER_CRASHED = const MessageKind( |
| 445 "Error: The compiler crashed when compiling this element."); | 449 "Error: The compiler crashed when compiling this element."); |
| 446 | 450 |
| 447 static const PLEASE_REPORT_THE_CRASH = const MessageKind(''' | 451 static const PLEASE_REPORT_THE_CRASH = const MessageKind(''' |
| 448 The compiler is broken. | 452 The compiler is broken. |
| 449 | 453 |
| 450 When compiling the above element, the compiler crashed. It is not | 454 When compiling the above element, the compiler crashed. It is not |
| 451 possible to tell if this is caused by a problem in your program or | 455 possible to tell if this is caused by a problem in your program or |
| 452 not. Regardless, the compiler should not crash. | 456 not. Regardless, the compiler should not crash. |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 633 |
| 630 class CompileTimeConstantError extends Diagnostic { | 634 class CompileTimeConstantError extends Diagnostic { |
| 631 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) | 635 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) |
| 632 : super(kind, arguments); | 636 : super(kind, arguments); |
| 633 } | 637 } |
| 634 | 638 |
| 635 class CompilationError extends Diagnostic { | 639 class CompilationError extends Diagnostic { |
| 636 CompilationError(MessageKind kind, [Map arguments = const {}]) | 640 CompilationError(MessageKind kind, [Map arguments = const {}]) |
| 637 : super(kind, arguments); | 641 : super(kind, arguments); |
| 638 } | 642 } |
| OLD | NEW |