| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 NO_SUPER_IN_OBJECT = const MessageKind( | 49 static final NO_SUPER_IN_OBJECT = const MessageKind( |
| 50 "'Object' does not have a superclass"); | 50 "'Object' does not have a superclass"); |
| 51 static final CANNOT_FIND_CONSTRUCTOR = const MessageKind( | 51 static final CANNOT_FIND_CONSTRUCTOR = const MessageKind( |
| 52 'cannot find constructor #{1}'); | 52 'cannot find constructor #{1}'); |
| 53 static final CANNOT_FIND_CONSTRUCTOR2 = const MessageKind( |
| 54 'cannot find constructor #{1} or #{2}'); |
| 53 static final CYCLIC_CLASS_HIERARCHY = const MessageKind( | 55 static final CYCLIC_CLASS_HIERARCHY = const MessageKind( |
| 54 '#{1} creates a cycle in the class hierarchy'); | 56 '#{1} creates a cycle in the class hierarchy'); |
| 55 static final INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( | 57 static final INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( |
| 56 'field initializer expected'); | 58 'field initializer expected'); |
| 57 static final NO_SUPER_IN_STATIC = const MessageKind( | 59 static final NO_SUPER_IN_STATIC = const MessageKind( |
| 58 "'super' is only available in instance methods"); | 60 "'super' is only available in instance methods"); |
| 59 static final DUPLICATE_INITIALIZER = const MessageKind( | 61 static final DUPLICATE_INITIALIZER = const MessageKind( |
| 60 'field #{1} is initialized more than once'); | 62 'field #{1} is initialized more than once'); |
| 61 static final ALREADY_INITIALIZED = const MessageKind( | 63 static final ALREADY_INITIALIZED = const MessageKind( |
| 62 '#{1} was already initialized here'); | 64 '#{1} was already initialized here'); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 109 |
| 108 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( | 110 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( |
| 109 '#{1} cannot be used as compile-time constant'); | 111 '#{1} cannot be used as compile-time constant'); |
| 110 | 112 |
| 111 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( | 113 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( |
| 112 '#{1} has no member named #{2}'); | 114 '#{1} has no member named #{2}'); |
| 113 | 115 |
| 114 static final CANNOT_INSTANTIATE_INTERFACE = const MessageKind( | 116 static final CANNOT_INSTANTIATE_INTERFACE = const MessageKind( |
| 115 "cannot instantiate interface '#{1}'"); | 117 "cannot instantiate interface '#{1}'"); |
| 116 | 118 |
| 119 static final NO_DEFAULT_CLASS = const MessageKind( |
| 120 "no default class on enclosing interface '#{1}'"); |
| 121 |
| 117 toString() => template; | 122 toString() => template; |
| 118 } | 123 } |
| 119 | 124 |
| 120 class Message { | 125 class Message { |
| 121 final kind; | 126 final kind; |
| 122 final List arguments; | 127 final List arguments; |
| 123 String message; | 128 String message; |
| 124 | 129 |
| 125 Message(this.kind, this.arguments); | 130 Message(this.kind, this.arguments); |
| 126 | 131 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 String toString() => message.toString(); | 170 String toString() => message.toString(); |
| 166 } | 171 } |
| 167 | 172 |
| 168 class CompileTimeConstantError { | 173 class CompileTimeConstantError { |
| 169 final Message message; | 174 final Message message; |
| 170 CompileTimeConstantError.message(this.message); | 175 CompileTimeConstantError.message(this.message); |
| 171 CompileTimeConstantError(MessageKind kind, List<Type> arguments) | 176 CompileTimeConstantError(MessageKind kind, List<Type> arguments) |
| 172 : message = new Message(kind, arguments); | 177 : message = new Message(kind, arguments); |
| 173 String toString() => message.toString(); | 178 String toString() => message.toString(); |
| 174 } | 179 } |
| OLD | NEW |