diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart index 89a646062c0..a9ad9102f41 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart @@ -600,7 +600,7 @@ class Parser { _isIdentifierOrQuestionIdentifier(endParen.next!)) { // Looks like a typedef with a record. TypeInfo typeInfo = computeType(keyword, /* required = */ false); - if (typeInfo is ComplexTypeInfo && typeInfo.recordType) { + if (typeInfo is ComplexTypeInfo && typeInfo.isRecordType) { typedefWithRecord = true; } } @@ -1423,7 +1423,7 @@ class Parser { /// ( ',' recordTypeNamedField )* ','? '}' /// recordTypeNamedField ::= metadata type identifier Token parseRecordType( - final Token start, Token token, bool questionMarkPartOfType) { + final Token start, Token token, bool isQuestionMarkPartOfType) { token = token.next!; assert(optional('(', token)); @@ -1503,7 +1503,7 @@ class Parser { // Only consume the `?` if it is part of the type. Token? questionMark = token.next!; - if (optional('?', questionMark) && questionMarkPartOfType) { + if (optional('?', questionMark) && isQuestionMarkPartOfType) { token = questionMark; } else { questionMark = null; diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart index 8d284db7552..e67527060cf 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart @@ -405,7 +405,7 @@ TypeParamOrArgInfo computeTypeParamOrArg(Token token, if (isPossibleRecordType(next)) { TypeInfo type = computeType(beginGroup, /* required = */ false); if (type is ComplexTypeInfo && - (type.recordType || type.gftReturnTypeHasRecordType) && + (type.isRecordType || type.gftReturnTypeHasRecordType) && !type.recovered) { // Looks like a record type. recordType = true; diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart index 396939e66f7..db7a158b274 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart @@ -510,7 +510,7 @@ class ComplexTypeInfo implements TypeInfo { bool? gftHasReturnType; /// If the type is a record type. - bool recordType = false; + bool isRecordType = false; /// If this is a generalized function type with a record type included in the /// return type. E.g. `(int, int) Function(bool) Function(int)`. @@ -532,7 +532,7 @@ class ComplexTypeInfo implements TypeInfo { this.end, this.typeVariableStarters, this.gftHasReturnType, - this.recordType, + this.isRecordType, this.gftReturnTypeHasRecordType, this.recovered); @@ -546,7 +546,7 @@ class ComplexTypeInfo implements TypeInfo { beforeQuestionMark, typeVariableStarters, gftHasReturnType, - recordType, + isRecordType, gftReturnTypeHasRecordType, recovered); } @@ -599,12 +599,12 @@ class ComplexTypeInfo implements TypeInfo { // Push the non-existing return type first. The loop below will // generate the full type. noType.parseType(token, parser); - } else if (recordType) { + } else if (isRecordType) { token = parser.parseRecordType(start, token, - /* questionMarkPartOfType = */ beforeQuestionMark != null); + /* isQuestionMarkPartOfType = */ beforeQuestionMark != null); } else if (gftReturnTypeHasRecordType) { token = parser.parseRecordType( - start, token, /* questionMarkPartOfType = */ true); + start, token, /* isQuestionMarkPartOfType = */ true); } else { Token typeRefOrPrefix = token.next!; if (optional('void', typeRefOrPrefix)) { @@ -794,7 +794,7 @@ class ComplexTypeInfo implements TypeInfo { token = token.next!; } - recordType = true; + isRecordType = true; assert(end != null); return this; diff --git a/pkg/front_end/test/parser_test_parser.dart b/pkg/front_end/test/parser_test_parser.dart index b1667512d6c..c5177e4b0b5 100644 --- a/pkg/front_end/test/parser_test_parser.dart +++ b/pkg/front_end/test/parser_test_parser.dart @@ -439,11 +439,11 @@ class TestParser extends Parser { @override Token parseRecordType( - final Token start, Token token, bool questionMarkPartOfType) { + final Token start, Token token, bool isQuestionMarkPartOfType) { doPrint( - 'parseRecordType(' '$start, ' '$token, ' '$questionMarkPartOfType)'); + 'parseRecordType(' '$start, ' '$token, ' '$isQuestionMarkPartOfType)'); indent++; - var result = super.parseRecordType(start, token, questionMarkPartOfType); + var result = super.parseRecordType(start, token, isQuestionMarkPartOfType); indent--; return result; }