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

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

Issue 1863803002: Validation of `@required` params (#26182). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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 3345a6168a5fb54e461b070db2214c4e7e876a3a..4a78c0d410d417db33f32faad601533bc673afe0 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -2683,6 +2683,7 @@ abstract class ErrorCode {
HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
HintCode.INVALID_ASSIGNMENT,
HintCode.INVALID_USE_OF_PROTECTED_MEMBER,
+ HintCode.MISSING_REQUIRED_PARAM,
HintCode.MISSING_RETURN,
HintCode.NULL_AWARE_IN_CONDITION,
HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER,
@@ -3572,6 +3573,17 @@ class HintCode extends ErrorCode {
"The member '{0}' can only be used within instance members of subclasses of '{1}'");
/**
+ * Generate a hint for a constructor, function or method invocation where a
+ * required parameter is missing.
+ *
+ * Parameters:
+ * 0: the name of the parameter
+ * 1: an optional reason
+ */
+ static const HintCode MISSING_REQUIRED_PARAM = const HintCode(
+ 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required. {1}");
+
+ /**
* Generate a hint for methods or functions that have a return type, but do
* not have a non-void return statement on all branches. At the end of methods
* or functions with no return, Dart implicitly returns `null`, avoiding these

Powered by Google App Engine
This is Rietveld 408576698