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

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

Issue 1407903011: Better error message when missing new or const (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 7920a62650a4685aa4c899b7d524ca7a810221b5..e29c5dca573cbbed2cb0687211b258268c331e87 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -4213,6 +4213,21 @@ class StaticTypeWarningCode extends ErrorCode {
"The method '{0}' is not defined for the class '{1}'");
/**
+ * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
+ * It is a static type warning if <i>T</i> does not have an accessible
+ * instance member named <i>m</i>.
+ *
+ * Parameters:
+ * 0: the name of the method that is undefined
+ * 1: the resolved type name that the method lookup is happening on
+ */
+ static const StaticTypeWarningCode UNDEFINED_METHOD_WITH_CONSTRUCTOR =
+ const StaticTypeWarningCode(
+ 'UNDEFINED_METHOD_WITH_CONSTRUCTOR',
+ "The method '{0}' is not defined for the class '{1}', but a constructor with that name is defined",
+ "Add 'new' or 'const' to invoke the constuctor, or change the method name.");
+
+ /**
* 12.18 Assignment: Evaluation of an assignment of the form
* <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
* equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/test/generated/static_type_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698