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

Unified Diff: pkg/analyzer/lib/src/error/codes.dart

Issue 2813553006: Split error code to ease future improvements (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « pkg/analyzer/lib/error/error.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/error/codes.dart
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index df5e5eeb84e2bb3759548f36402c1836ad2c171f..48df41b741e95b3072131ecdaf979932f813baa8 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -980,10 +980,30 @@ class CompileTimeErrorCode extends ErrorCode {
static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS =
const CompileTimeErrorCode(
'EXTRA_POSITIONAL_ARGUMENTS',
- "{0} positional arguments expected, but {1} found.",
+ "Too many positional arguments: {0} expected, but {1} found.",
"Try removing the extra arguments.");
/**
+ * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
+ * h</i> or if <i>m &gt; n</i>.
+ *
+ * 16.12.2 Const: It is a compile-time error if evaluation of a constant
+ * object results in an uncaught exception being thrown.
+ *
+ * Parameters:
+ * 0: the maximum number of positional arguments
+ * 1: the actual number of positional arguments given
+ *
+ * See [NOT_ENOUGH_REQUIRED_ARGUMENTS].
+ */
+ static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED =
+ const CompileTimeErrorCode(
+ 'EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED',
+ "Too many positional arguments: {0} expected, but {1} found.",
+ "Try removing the extra positional arguments, "
+ "or specifying the name for named arguments.");
+
+ /**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
* is a compile time error if more than one initializer corresponding to a
* given instance variable appears in <i>k</i>'s list.
@@ -3507,10 +3527,27 @@ class StaticWarningCode extends ErrorCode {
static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS =
const StaticWarningCode(
'EXTRA_POSITIONAL_ARGUMENTS',
- "{0} positional arguments expected, but {1} found.",
+ "Too many positional arguments: {0} expected, but {1} found.",
"Try removing the extra positional arguments.");
/**
+ * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
+ * h</i> or if <i>m &gt; n</i>.
+ *
+ * Parameters:
+ * 0: the maximum number of positional arguments
+ * 1: the actual number of positional arguments given
+ *
+ * See [NOT_ENOUGH_REQUIRED_ARGUMENTS].
+ */
+ static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED =
+ const StaticWarningCode(
+ 'EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED',
+ "Too many positional arguments: {0} expected, but {1} found.",
+ "Try removing the extra positional arguments, "
+ "or specifying the name for named arguments.");
+
+ /**
* 5. Variables: It is a static warning if a final instance variable that has
* been initialized at its point of declaration is also initialized in a
* constructor.
« no previous file with comments | « pkg/analyzer/lib/error/error.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698