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

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

Issue 2933753002: Run the sorter to reduce code churn (Closed)
Patch Set: Created 3 years, 6 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/src/generated/gn.dart ('k') | pkg/analyzer/lib/src/generated/workspace.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 206e451306255e2b3a8eb18a751b906f50832f06..a921af01ddff44fc190ee24022727c2be7c9c4f3 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -1027,24 +1027,6 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
}
}
- void _checkRequiredParameter(FormalParameterList node) {
- final requiredParameters =
- node.parameters.where((p) => p.element?.isRequired == true);
- final nonNamedParamsWithRequired =
- requiredParameters.where((p) => p.kind != ParameterKind.NAMED);
- final namedParamsWithRequiredAndDefault = requiredParameters
- .where((p) => p.kind == ParameterKind.NAMED)
- .where((p) => p.element.defaultValueCode != null);
- final paramsToHint = [
- nonNamedParamsWithRequired,
- namedParamsWithRequiredAndDefault
- ].expand((e) => e);
- for (final param in paramsToHint) {
- _errorReporter.reportErrorForNode(
- HintCode.INVALID_REQUIRED_PARAM, param, [param.identifier.name]);
- }
- }
-
/**
* Produce a hint if the given [condition] could have a value of `null`.
*/
@@ -1217,6 +1199,24 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
}
}
+ void _checkRequiredParameter(FormalParameterList node) {
+ final requiredParameters =
+ node.parameters.where((p) => p.element?.isRequired == true);
+ final nonNamedParamsWithRequired =
+ requiredParameters.where((p) => p.kind != ParameterKind.NAMED);
+ final namedParamsWithRequiredAndDefault = requiredParameters
+ .where((p) => p.kind == ParameterKind.NAMED)
+ .where((p) => p.element.defaultValueCode != null);
+ final paramsToHint = [
+ nonNamedParamsWithRequired,
+ namedParamsWithRequiredAndDefault
+ ].expand((e) => e);
+ for (final param in paramsToHint) {
+ _errorReporter.reportErrorForNode(
+ HintCode.INVALID_REQUIRED_PARAM, param, [param.identifier.name]);
+ }
+ }
+
/**
* Check for the passed class declaration for the
* [HintCode.OVERRIDE_EQUALS_BUT_NOT_HASH_CODE] hint code.
« no previous file with comments | « pkg/analyzer/lib/src/generated/gn.dart ('k') | pkg/analyzer/lib/src/generated/workspace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698