| 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 30 matching lines...) Expand all Loading... |
| 41 'missing return'); | 41 'missing return'); |
| 42 static const MAYBE_MISSING_RETURN = const MessageKind( | 42 static const MAYBE_MISSING_RETURN = const MessageKind( |
| 43 'not all paths lead to a return or throw statement'); | 43 'not all paths lead to a return or throw statement'); |
| 44 | 44 |
| 45 static const CANNOT_RESOLVE = const MessageKind( | 45 static const CANNOT_RESOLVE = const MessageKind( |
| 46 'cannot resolve #{name}'); | 46 'cannot resolve #{name}'); |
| 47 static const CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind( | 47 static const CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind( |
| 48 'cannot resolve constructor #{constructorName}'); | 48 'cannot resolve constructor #{constructorName}'); |
| 49 static const CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT = const MessageKind( | 49 static const CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT = const MessageKind( |
| 50 'cannot resolve constructor #{constructorName} for implicit super call'); | 50 'cannot resolve constructor #{constructorName} for implicit super call'); |
| 51 static const INVALID_UNNAMED_CONSTRUCTOR_NAME = const MessageKind( |
| 52 'Error: Unnamed constructor name must be #{name}.'); |
| 53 static const INVALID_CONSTRUCTOR_NAME = const MessageKind( |
| 54 'Error: Constructor name must start with #{name}.'); |
| 51 static const CANNOT_RESOLVE_TYPE = const MessageKind( | 55 static const CANNOT_RESOLVE_TYPE = const MessageKind( |
| 52 'cannot resolve type #{typeName}'); | 56 'cannot resolve type #{typeName}'); |
| 53 static const DUPLICATE_DEFINITION = const MessageKind( | 57 static const DUPLICATE_DEFINITION = const MessageKind( |
| 54 'duplicate definition of #{name}'); | 58 'duplicate definition of #{name}'); |
| 55 static const DUPLICATE_IMPORT = const MessageKind( | 59 static const DUPLICATE_IMPORT = const MessageKind( |
| 56 'duplicate import of #{name}'); | 60 'duplicate import of #{name}'); |
| 57 static const DUPLICATE_EXPORT = const MessageKind( | 61 static const DUPLICATE_EXPORT = const MessageKind( |
| 58 'duplicate export of #{name}'); | 62 'duplicate export of #{name}'); |
| 59 static const NOT_A_TYPE = const MessageKind( | 63 static const NOT_A_TYPE = const MessageKind( |
| 60 '#{node} is not a type'); | 64 '#{node} is not a type'); |
| 61 static const NOT_A_PREFIX = const MessageKind( | 65 static const NOT_A_PREFIX = const MessageKind( |
| 62 '#{node} is not a prefix'); | 66 '#{node} is not a prefix'); |
| 63 static const NO_SUPER_IN_OBJECT = const MessageKind( | 67 static const NO_SUPER_IN_OBJECT = const MessageKind( |
| 64 "'Object' does not have a superclass"); | 68 "'Object' does not have a superclass"); |
| 65 static const CANNOT_FIND_CONSTRUCTOR = const MessageKind( | 69 static const CANNOT_FIND_CONSTRUCTOR = const MessageKind( |
| 66 'cannot find constructor #{constructorName}'); | 70 'cannot find constructor #{constructorName}'); |
| 67 static const CANNOT_FIND_CONSTRUCTOR2 = const MessageKind( | |
| 68 'cannot find constructor #{constructorName} in #{className}'); | |
| 69 static const CYCLIC_CLASS_HIERARCHY = const MessageKind( | 71 static const CYCLIC_CLASS_HIERARCHY = const MessageKind( |
| 70 '#{className} creates a cycle in the class hierarchy'); | 72 '#{className} creates a cycle in the class hierarchy'); |
| 71 static const INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( | 73 static const INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( |
| 72 'field initializer expected'); | 74 'field initializer expected'); |
| 73 static const NO_SUPER_IN_STATIC = const MessageKind( | 75 static const NO_SUPER_IN_STATIC = const MessageKind( |
| 74 "'super' is only available in instance methods"); | 76 "'super' is only available in instance methods"); |
| 75 static const DUPLICATE_INITIALIZER = const MessageKind( | 77 static const DUPLICATE_INITIALIZER = const MessageKind( |
| 76 'field #{fieldName} is initialized more than once'); | 78 'field #{fieldName} is initialized more than once'); |
| 77 static const ALREADY_INITIALIZED = const MessageKind( | 79 static const ALREADY_INITIALIZED = const MessageKind( |
| 78 '#{fieldName} was already initialized here'); | 80 '#{fieldName} was already initialized here'); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 'cycle in the compile-time constant computation'); | 173 'cycle in the compile-time constant computation'); |
| 172 static const CONSTRUCTOR_IS_NOT_CONST = const MessageKind( | 174 static const CONSTRUCTOR_IS_NOT_CONST = const MessageKind( |
| 173 'constructor is not a const constructor'); | 175 'constructor is not a const constructor'); |
| 174 | 176 |
| 175 static const KEY_NOT_A_STRING_LITERAL = const MessageKind( | 177 static const KEY_NOT_A_STRING_LITERAL = const MessageKind( |
| 176 'map-literal key not a string literal'); | 178 'map-literal key not a string literal'); |
| 177 | 179 |
| 178 static const NO_SUCH_LIBRARY_MEMBER = const MessageKind( | 180 static const NO_SUCH_LIBRARY_MEMBER = const MessageKind( |
| 179 '#{libraryName} has no member named #{memberName}'); | 181 '#{libraryName} has no member named #{memberName}'); |
| 180 | 182 |
| 181 static const CANNOT_INSTANTIATE_INTERFACE = const MessageKind( | |
| 182 "cannot instantiate interface '#{interfaceName}'"); | |
| 183 | |
| 184 static const CANNOT_INSTANTIATE_TYPEDEF = const MessageKind( | 183 static const CANNOT_INSTANTIATE_TYPEDEF = const MessageKind( |
| 185 "cannot instantiate typedef '#{typedefName}'"); | 184 "cannot instantiate typedef '#{typedefName}'"); |
| 186 | 185 |
| 187 static const CANNOT_INSTANTIATE_TYPE_VARIABLE = const MessageKind( | 186 static const CANNOT_INSTANTIATE_TYPE_VARIABLE = const MessageKind( |
| 188 "cannot instantiate type variable '#{typeVariableName}'"); | 187 "cannot instantiate type variable '#{typeVariableName}'"); |
| 189 | 188 |
| 190 static const NO_DEFAULT_CLASS = const MessageKind( | 189 static const NO_DEFAULT_CLASS = const MessageKind( |
| 191 "no default class on enclosing interface '#{interfaceName}'"); | 190 "no default class on enclosing interface '#{interfaceName}'"); |
| 192 | 191 |
| 193 static const CYCLIC_TYPE_VARIABLE = const MessageKind( | 192 static const CYCLIC_TYPE_VARIABLE = const MessageKind( |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 | 594 |
| 596 class CompileTimeConstantError extends Diagnostic { | 595 class CompileTimeConstantError extends Diagnostic { |
| 597 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) | 596 CompileTimeConstantError(MessageKind kind, [Map arguments = const {}]) |
| 598 : super(kind, arguments); | 597 : super(kind, arguments); |
| 599 } | 598 } |
| 600 | 599 |
| 601 class CompilationError extends Diagnostic { | 600 class CompilationError extends Diagnostic { |
| 602 CompilationError(MessageKind kind, [Map arguments = const {}]) | 601 CompilationError(MessageKind kind, [Map arguments = const {}]) |
| 603 : super(kind, arguments); | 602 : super(kind, arguments); |
| 604 } | 603 } |
| OLD | NEW |