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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 'field #{1} is initialized more than once'); | 58 'field #{1} is initialized more than once'); |
| 59 static final ALREADY_INITIALIZED = const MessageKind( | 59 static final ALREADY_INITIALIZED = const MessageKind( |
| 60 '#{1} was already initialized here'); | 60 '#{1} was already initialized here'); |
| 61 static final INIT_STATIC_FIELD = const MessageKind( | 61 static final INIT_STATIC_FIELD = const MessageKind( |
| 62 'cannot initialize static field #{1}'); | 62 'cannot initialize static field #{1}'); |
| 63 static final NOT_A_FIELD = const MessageKind( | 63 static final NOT_A_FIELD = const MessageKind( |
| 64 '#{1} is not a field'); | 64 '#{1} is not a field'); |
| 65 static final INVALID_FOR_IN = const MessageKind( | 65 static final INVALID_FOR_IN = const MessageKind( |
| 66 'Invalid for-in variable declaration.'); | 66 'Invalid for-in variable declaration.'); |
| 67 | 67 |
| 68 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( | |
| 69 '#{1} cannot be used as compile-time constant.'); | |
| 70 | |
| 68 toString() => template; | 71 toString() => template; |
| 69 } | 72 } |
| 70 | 73 |
| 71 class Message { | 74 class Message { |
| 72 final kind; | 75 final kind; |
| 73 final List arguments; | 76 final List arguments; |
| 74 String message; | 77 String message; |
| 75 | 78 |
| 76 Message(this.kind, this.arguments); | 79 Message(this.kind, this.arguments); |
| 77 | 80 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 108 String toString() => message.toString(); | 111 String toString() => message.toString(); |
| 109 } | 112 } |
| 110 | 113 |
| 111 class ResolutionWarning { | 114 class ResolutionWarning { |
| 112 final Message message; | 115 final Message message; |
| 113 ResolutionWarning.message(this.message); | 116 ResolutionWarning.message(this.message); |
| 114 ResolutionWarning(MessageKind kind, List<Type> arguments) | 117 ResolutionWarning(MessageKind kind, List<Type> arguments) |
| 115 : message = new Message(kind, arguments); | 118 : message = new Message(kind, arguments); |
| 116 String toString() => message.toString(); | 119 String toString() => message.toString(); |
| 117 } | 120 } |
| 121 | |
| 122 class CompileTimeConstantError { | |
|
ngeoffray
2012/01/16 15:22:35
I would remove this. This looks like a ResolutionE
floitsch
2012/01/18 12:56:19
as discussed: keeping it, since there are CTC erro
| |
| 123 final Message message; | |
| 124 CompileTimeConstantError.message(this.message); | |
| 125 CompileTimeConstantError(MessageKind kind, List<Type> arguments) | |
| 126 : message = new Message(kind, arguments); | |
| 127 String toString() => message.toString(); | |
| 128 } | |
| OLD | NEW |