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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/warnings.dart
diff --git a/sdk/lib/_internal/compiler/implementation/warnings.dart b/sdk/lib/_internal/compiler/implementation/warnings.dart
index 5f5b74e096cb3497ae237f2f9a2d84ba719e57b6..1b63947e8db14e5a625f6a9e615b19c95e3a5766 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -258,6 +258,24 @@ class MessageKind {
static const EXTRA_FORMALS = const MessageKind(
"Error: Formal parameters are not allowed here.");
+ static const UNARY_OPERATOR_BAD_ARITY = const MessageKind(
+ "Error: Operator #{1} must have no parameters.");
+
+ static const MINUS_OPERATOR_BAD_ARITY = const MessageKind(
+ "Error: Operator - must have 0 or 1 parameters.");
+
+ static const BINARY_OPERATOR_BAD_ARITY = const MessageKind(
+ "Error: Operator #{1} must have exactly 1 parameter.");
+
+ static const TERNARY_OPERATOR_BAD_ARITY = const MessageKind(
+ "Error: Operator #{1} must have exactly 2 parameters.");
+
+ static const OPERATOR_OPTIONAL_PARAMETERS = const MessageKind(
+ "Error: Operator #{1} cannot have optional parameters.");
+
+ static const OPERATOR_NAMED_PARAMETERS = const MessageKind(
+ "Error: Operator #{1} cannot have named parameters.");
+
// TODO(ahe): This message is hard to localize. This is acceptable,
// as it will be removed when we ship Dart version 1.0.
static const DEPRECATED_FEATURE_WARNING = const MessageKind(

Powered by Google App Engine
This is Rietveld 408576698