Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 static final CANNOT_RESOLVE = const MessageKind( | 35 static final CANNOT_RESOLVE = const MessageKind( |
| 36 'cannot resolve #{1}'); | 36 'cannot resolve #{1}'); |
| 37 static final CANNOT_RESOLVE_TYPE = const MessageKind( | 37 static final CANNOT_RESOLVE_TYPE = const MessageKind( |
| 38 'cannot resolve type #{1}'); | 38 'cannot resolve type #{1}'); |
| 39 static final DUPLICATE_DEFINITION = const MessageKind( | 39 static final DUPLICATE_DEFINITION = const MessageKind( |
| 40 'duplicate definition of #{1}'); | 40 'duplicate definition of #{1}'); |
| 41 static final NOT_A_TYPE = const MessageKind( | 41 static final NOT_A_TYPE = const MessageKind( |
| 42 '#{1} is not a type'); | 42 '#{1} is not a type'); |
| 43 static final CANNOT_FIND_CONSTRUCTOR = const MessageKind( | 43 static final CANNOT_FIND_CONSTRUCTOR = const MessageKind( |
| 44 'cannot find constructor #{1}'); | 44 'cannot find constructor #{1}'); |
| 45 static final INVALID_RECEIVER_IN_INITIALIZER = const MessageKind( | |
| 46 'only \'this\' can be used as a receiver in an initializer'); | |
|
ahe
2011/12/19 18:07:26
Perhaps this error message could be improved and s
karlklose
2011/12/21 10:19:44
Done.
| |
| 47 static final DUPLICATION_INITIALIZATION = const MessageKind( | |
|
ngeoffray
2011/12/20 15:09:51
DUPLICATE_INITIALIZER?
karlklose
2011/12/21 10:19:44
Done.
| |
| 48 'field #{1} is initialized more than once'); | |
|
ahe
2011/12/19 18:07:26
I'd like to see the previous place it is initializ
karlklose
2011/12/21 10:19:44
Done, but I only print the node information, not t
ahe
2011/12/21 12:01:58
Why don't you have that information?
| |
| 45 | 49 |
| 46 toString() => template; | 50 toString() => template; |
| 47 } | 51 } |
| 48 | 52 |
| 49 class Message { | 53 class Message { |
| 50 final kind; | 54 final kind; |
| 51 final List arguments; | 55 final List arguments; |
| 52 String message; | 56 String message; |
| 53 | 57 |
| 54 Message(this.kind, this.arguments); | 58 Message(this.kind, this.arguments); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 String toString() => message.toString(); | 91 String toString() => message.toString(); |
| 88 } | 92 } |
| 89 | 93 |
| 90 class ResolutionWarning { | 94 class ResolutionWarning { |
| 91 final Message message; | 95 final Message message; |
| 92 ResolutionWarning.message(this.message); | 96 ResolutionWarning.message(this.message); |
| 93 ResolutionWarning(MessageKind kind, List<Type> arguments) | 97 ResolutionWarning(MessageKind kind, List<Type> arguments) |
| 94 : message = new Message(kind, arguments); | 98 : message = new Message(kind, arguments); |
| 95 String toString() => message.toString(); | 99 String toString() => message.toString(); |
| 96 } | 100 } |
| OLD | NEW |