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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 static final UNUSED_LABEL = const MessageKind( | 115 static final UNUSED_LABEL = const MessageKind( |
116 'unused label #{1}'); | 116 'unused label #{1}'); |
117 static final INVALID_CONTINUE = const MessageKind( | 117 static final INVALID_CONTINUE = const MessageKind( |
118 'target of continue is not a loop or switch case'); | 118 'target of continue is not a loop or switch case'); |
119 static final INVALID_USE_OF_SUPER = const MessageKind( | 119 static final INVALID_USE_OF_SUPER = const MessageKind( |
120 'super not allowed here'); | 120 'super not allowed here'); |
121 | 121 |
122 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( | 122 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( |
123 'not a compile-time constant'); | 123 'not a compile-time constant'); |
124 | 124 |
| 125 static final KEY_NOT_A_STRING_LITERAL = const MessageKind( |
| 126 'map-literal key not a string literal'); |
| 127 |
125 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( | 128 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( |
126 '#{1} has no member named #{2}'); | 129 '#{1} has no member named #{2}'); |
127 | 130 |
128 static final CANNOT_INSTANTIATE_INTERFACE = const MessageKind( | 131 static final CANNOT_INSTANTIATE_INTERFACE = const MessageKind( |
129 "cannot instantiate interface '#{1}'"); | 132 "cannot instantiate interface '#{1}'"); |
130 | 133 |
131 static final CANNOT_INSTANTIATE_TYPEDEF = const MessageKind( | 134 static final CANNOT_INSTANTIATE_TYPEDEF = const MessageKind( |
132 "cannot instantiate typedef '#{1}'"); | 135 "cannot instantiate typedef '#{1}'"); |
133 | 136 |
134 static final NO_DEFAULT_CLASS = const MessageKind( | 137 static final NO_DEFAULT_CLASS = const MessageKind( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 String toString() => message.toString(); | 197 String toString() => message.toString(); |
195 } | 198 } |
196 | 199 |
197 class CompileTimeConstantError { | 200 class CompileTimeConstantError { |
198 final Message message; | 201 final Message message; |
199 CompileTimeConstantError.message(this.message); | 202 CompileTimeConstantError.message(this.message); |
200 CompileTimeConstantError(MessageKind kind, List<Type> arguments) | 203 CompileTimeConstantError(MessageKind kind, List<Type> arguments) |
201 : message = new Message(kind, arguments); | 204 : message = new Message(kind, arguments); |
202 String toString() => message.toString(); | 205 String toString() => message.toString(); |
203 } | 206 } |
OLD | NEW |