Index: pkg/analyzer/lib/src/generated/parser.dart |
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
index 0170d362cebbb3b049ae8d13d2998e1f75c9bfe8..045a8c459e9414b1e3e4c2fbe478a522c485e653 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -4163,13 +4163,14 @@ class Parser { |
period = _expect(TokenType.PERIOD); |
} |
if (!_matchesIdentifier() && inFunctionType) { |
- return astFactory.simpleFormalParameter( |
+ SimpleFormalParameterImpl parameter = astFactory.simpleFormalParameter( |
commentAndMetadata.comment, |
commentAndMetadata.metadata, |
- covariantKeyword, |
holder.keyword, |
holder.type, |
null); |
+ parameter.covariantKeyword = covariantKeyword; |
+ return parameter; |
} |
SimpleIdentifier identifier = parseSimpleIdentifier(); |
TypeParameterList typeParameters = _parseGenericMethodTypeParameters(); |
@@ -4184,20 +4185,22 @@ class Parser { |
if (enableNnbd && _matches(TokenType.QUESTION)) { |
question = getAndAdvance(); |
} |
- return astFactory.functionTypedFormalParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- covariantKeyword, |
- holder.type, |
- astFactory.simpleIdentifier(identifier.token, isDeclaration: true), |
- typeParameters, |
- parameters, |
- question: question); |
+ FunctionTypedFormalParameterImpl parameter = |
+ astFactory.functionTypedFormalParameter( |
+ commentAndMetadata.comment, |
+ commentAndMetadata.metadata, |
+ holder.type, |
+ astFactory.simpleIdentifier(identifier.token, |
+ isDeclaration: true), |
+ typeParameters, |
+ parameters, |
+ question: question); |
+ parameter.covariantKeyword = covariantKeyword; |
+ return parameter; |
} else { |
- return astFactory.fieldFormalParameter( |
+ FieldFormalParameterImpl parameter = astFactory.fieldFormalParameter( |
commentAndMetadata.comment, |
commentAndMetadata.metadata, |
- covariantKeyword, |
holder.keyword, |
holder.type, |
thisKeyword, |
@@ -4205,6 +4208,8 @@ class Parser { |
identifier, |
typeParameters, |
parameters); |
+ parameter.covariantKeyword = covariantKeyword; |
+ return parameter; |
} |
} else if (typeParameters != null) { |
// TODO(brianwilkerson) Report an error. It looks like a function-typed |
@@ -4226,10 +4231,9 @@ class Parser { |
// TODO(brianwilkerson) If there are type parameters but no parameters, |
// should we create a synthetic empty parameter list here so we can |
// capture the type parameters? |
- return astFactory.fieldFormalParameter( |
+ FieldFormalParameterImpl parameter = astFactory.fieldFormalParameter( |
commentAndMetadata.comment, |
commentAndMetadata.metadata, |
- covariantKeyword, |
holder.keyword, |
type, |
thisKeyword, |
@@ -4237,14 +4241,17 @@ class Parser { |
identifier, |
null, |
null); |
+ parameter.covariantKeyword = covariantKeyword; |
+ return parameter; |
} |
- return astFactory.simpleFormalParameter( |
+ SimpleFormalParameterImpl parameter = astFactory.simpleFormalParameter( |
commentAndMetadata.comment, |
commentAndMetadata.metadata, |
- covariantKeyword, |
holder.keyword, |
type, |
astFactory.simpleIdentifier(identifier.token, isDeclaration: true)); |
+ parameter.covariantKeyword = covariantKeyword; |
+ return parameter; |
} |
/** |