diff --git a/pkg/analyzer/lib/dart/element/type.dart b/pkg/analyzer/lib/dart/element/type.dart index 7e84b9d473c5..d25baf83b779 100644 --- a/pkg/analyzer/lib/dart/element/type.dart +++ b/pkg/analyzer/lib/dart/element/type.dart @@ -574,8 +574,7 @@ abstract class ParameterizedType implements DartType { /// The type of a record literal or a record type annotation. /// /// Clients may not extend, implement or mix-in this class. -abstract class RecordType - implements DartType, SharedRecordTypeStructure { +abstract class RecordType implements DartType { /// Creates a record type from of [positional] and [named] fields. factory RecordType({ required List positional, @@ -591,6 +590,24 @@ abstract class RecordType /// The positional fields (might be empty). List get positionalFields; + + /// The types of the positional fields (might be empty). + /// + /// Deprecated: this getter is a part of the analyzer's private + /// implementation, and was exposed by accident (see + /// https://github.com/dart-lang/sdk/issues/59763). Please use + /// [positionalFields] instead. + @Deprecated('Use positionalFields instead') + List get positionalTypes; + + /// All the named fields, sorted by name (might be empty). + /// + /// Deprecated: this getter is a part of the analyzer's private + /// implementation, and was exposed by accident (see + /// https://github.com/dart-lang/sdk/issues/59763). Please use [namedFields] + /// instead. + @Deprecated('Use namedFields instead') + List get sortedNamedTypes; } /// A field in a [RecordType]. diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart index 682070a222e9..f541df5f5c13 100644 --- a/pkg/analyzer/lib/src/dart/element/type.dart +++ b/pkg/analyzer/lib/src/dart/element/type.dart @@ -1338,7 +1338,8 @@ abstract class RecordTypeFieldImpl implements RecordTypeField { }); } -class RecordTypeImpl extends TypeImpl implements RecordType { +class RecordTypeImpl extends TypeImpl + implements RecordType, SharedRecordTypeStructure { @override final List positionalFields; @@ -1395,10 +1396,10 @@ class RecordTypeImpl extends TypeImpl implements RecordType { @override String? get name => null; - List> get namedTypes => namedFields; + List get namedTypes => namedFields; @override - List> get sortedNamedTypes => namedTypes; + List get sortedNamedTypes => namedTypes; @override bool operator ==(Object other) {