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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 11778039: Report arity errors on user definable operators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 11 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
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 part of dart2js; 5 part of dart2js;
6 6
7 class MessageKind { 7 class MessageKind {
8 final String template; 8 final String template;
9 const MessageKind(this.template); 9 const MessageKind(this.template);
10 10
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 static const BAD_ARITY_OVERRIDE_CONT = const MessageKind( 252 static const BAD_ARITY_OVERRIDE_CONT = const MessageKind(
253 "Info: this is the method whose parameters do not match."); 253 "Info: this is the method whose parameters do not match.");
254 254
255 static const MISSING_FORMALS = const MessageKind( 255 static const MISSING_FORMALS = const MessageKind(
256 "Error: Formal parameters are missing."); 256 "Error: Formal parameters are missing.");
257 257
258 static const EXTRA_FORMALS = const MessageKind( 258 static const EXTRA_FORMALS = const MessageKind(
259 "Error: Formal parameters are not allowed here."); 259 "Error: Formal parameters are not allowed here.");
260 260
261 static const UNARY_OPERATOR_BAD_ARITY = const MessageKind(
262 "Error: Operator #{1} must have no parameters.");
263
264 static const MINUS_OPERATOR_BAD_ARITY = const MessageKind(
265 "Error: Operator - must have 0 or 1 parameters.");
266
267 static const BINARY_OPERATOR_BAD_ARITY = const MessageKind(
268 "Error: Operator #{1} must have exactly 1 parameter.");
269
270 static const TERNARY_OPERATOR_BAD_ARITY = const MessageKind(
271 "Error: Operator #{1} must have exactly 2 parameters.");
272
273 static const OPERATOR_OPTIONAL_PARAMETERS = const MessageKind(
274 "Error: Operator #{1} cannot have optional parameters.");
275
276 static const OPERATOR_NAMED_PARAMETERS = const MessageKind(
277 "Error: Operator #{1} cannot have named parameters.");
278
261 // TODO(ahe): This message is hard to localize. This is acceptable, 279 // TODO(ahe): This message is hard to localize. This is acceptable,
262 // as it will be removed when we ship Dart version 1.0. 280 // as it will be removed when we ship Dart version 1.0.
263 static const DEPRECATED_FEATURE_WARNING = const MessageKind( 281 static const DEPRECATED_FEATURE_WARNING = const MessageKind(
264 "Warning: deprecated language feature, #{1}, " 282 "Warning: deprecated language feature, #{1}, "
265 "will be removed in a future Dart milestone."); 283 "will be removed in a future Dart milestone.");
266 284
267 // TODO(ahe): This message is hard to localize. This is acceptable, 285 // TODO(ahe): This message is hard to localize. This is acceptable,
268 // as it will be removed when we ship Dart version 1.0. 286 // as it will be removed when we ship Dart version 1.0.
269 static const DEPRECATED_FEATURE_ERROR = const MessageKind( 287 static const DEPRECATED_FEATURE_ERROR = const MessageKind(
270 "Error: #{1} are not legal " 288 "Error: #{1} are not legal "
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 460
443 class CompileTimeConstantError extends Diagnostic { 461 class CompileTimeConstantError extends Diagnostic {
444 CompileTimeConstantError(MessageKind kind, List arguments) 462 CompileTimeConstantError(MessageKind kind, List arguments)
445 : super(kind, arguments); 463 : super(kind, arguments);
446 } 464 }
447 465
448 class CompilationError extends Diagnostic { 466 class CompilationError extends Diagnostic {
449 CompilationError(MessageKind kind, List arguments) 467 CompilationError(MessageKind kind, List arguments)
450 : super(kind, arguments); 468 : super(kind, arguments);
451 } 469 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698