| Index: pkg/analyzer/lib/src/generated/error_verifier.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| index befeccf958640ff7291ed70d062ba857e77308f3..c68aa1e3353617af79685e16289749774938c305 100644
|
| --- a/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| @@ -739,6 +739,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| @override
|
| Object visitFormalParameterList(FormalParameterList node) {
|
| _checkDuplicateDefinitionInParameterList(node);
|
| + _checkUseOfCovariantInParameters(node);
|
| return super.visitFormalParameterList(node);
|
| }
|
|
|
| @@ -6170,6 +6171,23 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
| }
|
|
|
| + void _checkUseOfCovariantInParameters(FormalParameterList node) {
|
| + AstNode parent = node.parent;
|
| + if (parent is MethodDeclaration && !parent.isStatic) {
|
| + return;
|
| + }
|
| + NodeList<FormalParameter> parameters = node.parameters;
|
| + int length = parameters.length;
|
| + for (int i = 0; i < length; i++) {
|
| + FormalParameter parameter = parameters[i];
|
| + Token keyword = parameter.covariantKeyword;
|
| + if (keyword != null) {
|
| + _errorReporter.reportErrorForToken(
|
| + CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, keyword);
|
| + }
|
| + }
|
| + }
|
| +
|
| DartType _computeReturnTypeForMethod(Expression returnExpression) {
|
| // This method should never be called for generators, since generators are
|
| // never allowed to contain return statements with expressions.
|
|
|