| 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 class MessageKind { | 5 class MessageKind { |
| 6 final String template; | 6 final String template; |
| 7 const MessageKind(this.template); | 7 const MessageKind(this.template); |
| 8 | 8 |
| 9 static final GENERIC = const MessageKind('#{1}'); | 9 static final GENERIC = const MessageKind('#{1}'); |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 'field #{1} is initialized more than once'); | 60 'field #{1} is initialized more than once'); |
| 61 static final ALREADY_INITIALIZED = const MessageKind( | 61 static final ALREADY_INITIALIZED = const MessageKind( |
| 62 '#{1} was already initialized here'); | 62 '#{1} was already initialized here'); |
| 63 static final INIT_STATIC_FIELD = const MessageKind( | 63 static final INIT_STATIC_FIELD = const MessageKind( |
| 64 'cannot initialize static field #{1}'); | 64 'cannot initialize static field #{1}'); |
| 65 static final NOT_A_FIELD = const MessageKind( | 65 static final NOT_A_FIELD = const MessageKind( |
| 66 '#{1} is not a field'); | 66 '#{1} is not a field'); |
| 67 static final CONSTRUCTOR_CALL_EXPECTED = const MessageKind( | 67 static final CONSTRUCTOR_CALL_EXPECTED = const MessageKind( |
| 68 "only call to 'this' or 'super' constructor allowed"); | 68 "only call to 'this' or 'super' constructor allowed"); |
| 69 static final INVALID_FOR_IN = const MessageKind( | 69 static final INVALID_FOR_IN = const MessageKind( |
| 70 'Invalid for-in variable declaration.'); | 70 'invalid for-in variable declaration.'); |
| 71 static final REDIRECTING_CTOR_HAS_INITIALIZER = const MessageKind( | 71 static final INVALID_INITIALIZER = const MessageKind( |
| 72 'invalid initializer'); |
| 73 static final FUNCTION_WITH_INITIALIZER = const MessageKind( |
| 74 'only constructors can have initializers'); |
| 75 static final REDIRECTING_CONSTRUCTOR_CYCLE = const MessageKind( |
| 76 'cyclic constructor redirection'); |
| 77 static final REDIRECTING_CONSTRUCTOR_HAS_BODY = const MessageKind( |
| 78 'redirecting constructor cannot have a body'); |
| 79 static final REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER = const MessageKind( |
| 72 'redirecting constructor cannot have other initializers'); | 80 'redirecting constructor cannot have other initializers'); |
| 73 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind( | 81 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind( |
| 74 "'Object' cannot have a super initializer"); | 82 "'Object' cannot have a super initializer"); |
| 75 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind( | 83 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind( |
| 76 'cannot have more than one super initializer'); | 84 'cannot have more than one super initializer'); |
| 77 static final NO_MATCHING_CONSTRUCTOR = const MessageKind( | 85 static final NO_MATCHING_CONSTRUCTOR = const MessageKind( |
| 78 'no matching constructor found'); | 86 'no matching constructor found'); |
| 79 static final NO_CONSTRUCTOR = const MessageKind( | 87 static final NO_CONSTRUCTOR = const MessageKind( |
| 80 '#{1} is a #{2}, not a constructor'); | 88 '#{1} is a #{2}, not a constructor'); |
| 81 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind( | 89 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind( |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 String toString() => message.toString(); | 173 String toString() => message.toString(); |
| 166 } | 174 } |
| 167 | 175 |
| 168 class CompileTimeConstantError { | 176 class CompileTimeConstantError { |
| 169 final Message message; | 177 final Message message; |
| 170 CompileTimeConstantError.message(this.message); | 178 CompileTimeConstantError.message(this.message); |
| 171 CompileTimeConstantError(MessageKind kind, List<Type> arguments) | 179 CompileTimeConstantError(MessageKind kind, List<Type> arguments) |
| 172 : message = new Message(kind, arguments); | 180 : message = new Message(kind, arguments); |
| 173 String toString() => message.toString(); | 181 String toString() => message.toString(); |
| 174 } | 182 } |
| OLD | NEW |