| 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 28 matching lines...) Expand all Loading... |
| 39 static final CANNOT_RESOLVE = const MessageKind( | 39 static final CANNOT_RESOLVE = const MessageKind( |
| 40 'cannot resolve #{1}'); | 40 'cannot resolve #{1}'); |
| 41 static final CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind( | 41 static final CANNOT_RESOLVE_CONSTRUCTOR = const MessageKind( |
| 42 'cannot resolve constructor #{1}'); | 42 'cannot resolve constructor #{1}'); |
| 43 static final CANNOT_RESOLVE_TYPE = const MessageKind( | 43 static final CANNOT_RESOLVE_TYPE = const MessageKind( |
| 44 'cannot resolve type #{1}'); | 44 'cannot resolve type #{1}'); |
| 45 static final DUPLICATE_DEFINITION = const MessageKind( | 45 static final DUPLICATE_DEFINITION = const MessageKind( |
| 46 'duplicate definition of #{1}'); | 46 'duplicate definition of #{1}'); |
| 47 static final NOT_A_TYPE = const MessageKind( | 47 static final NOT_A_TYPE = const MessageKind( |
| 48 '#{1} is not a type'); | 48 '#{1} is not a type'); |
| 49 static final NOT_A_PREFIX = const MessageKind( |
| 50 '#{1} is not a prefix'); |
| 49 static final NO_SUPER_IN_OBJECT = const MessageKind( | 51 static final NO_SUPER_IN_OBJECT = const MessageKind( |
| 50 "'Object' does not have a superclass"); | 52 "'Object' does not have a superclass"); |
| 51 static final CANNOT_FIND_CONSTRUCTOR = const MessageKind( | 53 static final CANNOT_FIND_CONSTRUCTOR = const MessageKind( |
| 52 'cannot find constructor #{1}'); | 54 'cannot find constructor #{1}'); |
| 53 static final CANNOT_FIND_CONSTRUCTOR2 = const MessageKind( | 55 static final CANNOT_FIND_CONSTRUCTOR2 = const MessageKind( |
| 54 'cannot find constructor #{1} or #{2}'); | 56 'cannot find constructor #{1} or #{2}'); |
| 55 static final CYCLIC_CLASS_HIERARCHY = const MessageKind( | 57 static final CYCLIC_CLASS_HIERARCHY = const MessageKind( |
| 56 '#{1} creates a cycle in the class hierarchy'); | 58 '#{1} creates a cycle in the class hierarchy'); |
| 57 static final INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( | 59 static final INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( |
| 58 'field initializer expected'); | 60 'field initializer expected'); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 static final NO_CONTINUE_TARGET = const MessageKind( | 109 static final NO_CONTINUE_TARGET = const MessageKind( |
| 108 'continue statement not inside loop'); | 110 'continue statement not inside loop'); |
| 109 static final EXISTING_LABEL = const MessageKind( | 111 static final EXISTING_LABEL = const MessageKind( |
| 110 'original declaration of duplicate label #{1}'); | 112 'original declaration of duplicate label #{1}'); |
| 111 static final DUPLICATE_LABEL = const MessageKind( | 113 static final DUPLICATE_LABEL = const MessageKind( |
| 112 'duplicate declaration of label #{1}'); | 114 'duplicate declaration of label #{1}'); |
| 113 static final UNUSED_LABEL = const MessageKind( | 115 static final UNUSED_LABEL = const MessageKind( |
| 114 'unused label #{1}'); | 116 'unused label #{1}'); |
| 115 static final INVALID_CONTINUE = const MessageKind( | 117 static final INVALID_CONTINUE = const MessageKind( |
| 116 '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( |
| 120 'super not allowed here'); |
| 117 | 121 |
| 118 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( | 122 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( |
| 119 'not a compile-time constant'); | 123 'not a compile-time constant'); |
| 120 | 124 |
| 121 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( | 125 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( |
| 122 '#{1} has no member named #{2}'); | 126 '#{1} has no member named #{2}'); |
| 123 | 127 |
| 124 static final CANNOT_INSTANTIATE_INTERFACE = const MessageKind( | 128 static final CANNOT_INSTANTIATE_INTERFACE = const MessageKind( |
| 125 "cannot instantiate interface '#{1}'"); | 129 "cannot instantiate interface '#{1}'"); |
| 126 | 130 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 String toString() => message.toString(); | 194 String toString() => message.toString(); |
| 191 } | 195 } |
| 192 | 196 |
| 193 class CompileTimeConstantError { | 197 class CompileTimeConstantError { |
| 194 final Message message; | 198 final Message message; |
| 195 CompileTimeConstantError.message(this.message); | 199 CompileTimeConstantError.message(this.message); |
| 196 CompileTimeConstantError(MessageKind kind, List<Type> arguments) | 200 CompileTimeConstantError(MessageKind kind, List<Type> arguments) |
| 197 : message = new Message(kind, arguments); | 201 : message = new Message(kind, arguments); |
| 198 String toString() => message.toString(); | 202 String toString() => message.toString(); |
| 199 } | 203 } |
| OLD | NEW |