Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: frog/leg/warnings.dart

Issue 9310066: Generate a resolution error if a unary + is used for something other than numbers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/leg/tree/nodes.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 'redirecting constructor cannot have other initializers'); 72 'redirecting constructor cannot have other initializers');
73 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind( 73 static final SUPER_INITIALIZER_IN_OBJECT = const MessageKind(
74 "'Object' cannot have a super initializer"); 74 "'Object' cannot have a super initializer");
75 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind( 75 static final DUPLICATE_SUPER_INITIALIZER = const MessageKind(
76 'cannot have more than one super initializer'); 76 'cannot have more than one super initializer');
77 static final NO_MATCHING_CONSTRUCTOR = const MessageKind( 77 static final NO_MATCHING_CONSTRUCTOR = const MessageKind(
78 'no matching constructor found'); 78 'no matching constructor found');
79 static final NO_CONSTRUCTOR = const MessageKind( 79 static final NO_CONSTRUCTOR = const MessageKind(
80 '#{1} is a #{2}, not a constructor'); 80 '#{1} is a #{2}, not a constructor');
81 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind( 81 static final FIELD_PARAMETER_NOT_ALLOWED = const MessageKind(
82 'A field parameter is only allowed in generative constructors'); 82 'a field parameter is only allowed in generative constructors');
83 static final INVALID_PARAMETER = const MessageKind( 83 static final INVALID_PARAMETER = const MessageKind(
84 "Cannot resolve parameter"); 84 "cannot resolve parameter");
85 static final NOT_INSTANCE_FIELD = const MessageKind( 85 static final NOT_INSTANCE_FIELD = const MessageKind(
86 '#{1} is not an instance field'); 86 '#{1} is not an instance field');
87 static final EXPECTED_LITERAL_NUMBER = const MessageKind(
88 'expected a literal number after +');
87 89
88 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( 90 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind(
89 '#{1} cannot be used as compile-time constant'); 91 '#{1} cannot be used as compile-time constant');
90 92
91 toString() => template; 93 toString() => template;
92 } 94 }
93 95
94 class Message { 96 class Message {
95 final kind; 97 final kind;
96 final List arguments; 98 final List arguments;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 String toString() => message.toString(); 141 String toString() => message.toString();
140 } 142 }
141 143
142 class CompileTimeConstantError { 144 class CompileTimeConstantError {
143 final Message message; 145 final Message message;
144 CompileTimeConstantError.message(this.message); 146 CompileTimeConstantError.message(this.message);
145 CompileTimeConstantError(MessageKind kind, List<Type> arguments) 147 CompileTimeConstantError(MessageKind kind, List<Type> arguments)
146 : message = new Message(kind, arguments); 148 : message = new Message(kind, arguments);
147 String toString() => message.toString(); 149 String toString() => message.toString();
148 } 150 }
OLDNEW
« no previous file with comments | « frog/leg/tree/nodes.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698