Skip to content

Commit 6fe5afc

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Return List<InterfaceTypeImpl> from InterfaceElementImpl2.allSupertypes
Change-Id: I6c62a146c56ab22e3be9e777f3f968bd218ca5ca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429823 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 208b5d8 commit 6fe5afc

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

pkg/analyzer/lib/src/dart/element/class_hierarchy.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:analyzer/dart/element/nullability_suffix.dart';
6-
import 'package:analyzer/dart/element/type.dart';
76
import 'package:analyzer/src/dart/element/element.dart';
87
import 'package:analyzer/src/dart/element/type.dart';
98
import 'package:analyzer/src/dart/element/type_algebra.dart';
@@ -17,7 +16,7 @@ class ClassHierarchy {
1716
return _getHierarchy(element).errors;
1817
}
1918

20-
List<InterfaceType> implementedInterfaces(InterfaceElementImpl2 element) {
19+
List<InterfaceTypeImpl> implementedInterfaces(InterfaceElementImpl2 element) {
2120
return _getHierarchy(element).interfaces;
2221
}
2322

@@ -45,7 +44,7 @@ class ClassHierarchy {
4544

4645
hierarchy = _Hierarchy(
4746
errors: const <ClassHierarchyError>[],
48-
interfaces: const <InterfaceType>[],
47+
interfaces: const <InterfaceTypeImpl>[],
4948
);
5049
_map[element] = hierarchy;
5150

@@ -82,7 +81,7 @@ class ClassHierarchy {
8281
}
8382

8483
var errors = <ClassHierarchyError>[];
85-
var interfaces = <InterfaceType>[];
84+
var interfaces = <InterfaceTypeImpl>[];
8685
for (var collector in interfacesMerger._map.values) {
8786
var error = collector._error;
8887
if (error != null) {
@@ -111,8 +110,8 @@ abstract class ClassHierarchyError {}
111110
/// In opted-in libraries NNBD_TOP_MERGE of NORM of the interfaces must be
112111
/// successful.
113112
class IncompatibleInterfacesClassHierarchyError extends ClassHierarchyError {
114-
final InterfaceType first;
115-
final InterfaceType second;
113+
final InterfaceTypeImpl first;
114+
final InterfaceTypeImpl second;
116115

117116
IncompatibleInterfacesClassHierarchyError(this.first, this.second);
118117
}
@@ -207,7 +206,7 @@ class _ClassInterfaceType {
207206

208207
class _Hierarchy {
209208
List<ClassHierarchyError> errors;
210-
List<InterfaceType> interfaces;
209+
List<InterfaceTypeImpl> interfaces;
211210

212211
_Hierarchy({required this.errors, required this.interfaces});
213212
}

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4957,10 +4957,10 @@ abstract class InterfaceElementImpl2 extends InstanceElementImpl2
49574957
InterfaceTypeImpl? _thisType;
49584958

49594959
/// The cached result of [allSupertypes].
4960-
List<InterfaceType>? _allSupertypes;
4960+
List<InterfaceTypeImpl>? _allSupertypes;
49614961

49624962
@override
4963-
List<InterfaceType> get allSupertypes {
4963+
List<InterfaceTypeImpl> get allSupertypes {
49644964
return _allSupertypes ??= library2.session.classHierarchy
49654965
.implementedInterfaces(this);
49664966
}

pkg/analyzer/lib/src/fine/library_manifest.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'dart:typed_data';
77
import 'package:analyzer/dart/element/element.dart';
88
import 'package:analyzer/src/dart/analysis/file_state.dart';
99
import 'package:analyzer/src/dart/element/element.dart';
10-
import 'package:analyzer/src/dart/element/type.dart';
1110
import 'package:analyzer/src/fine/lookup_name.dart';
1211
import 'package:analyzer/src/fine/manifest_context.dart';
1312
import 'package:analyzer/src/fine/manifest_id.dart';
@@ -754,7 +753,6 @@ class LibraryManifestBuilder {
754753

755754
// Ensure that we have interfaces of supertypes first.
756755
for (var superType in element.allSupertypes) {
757-
superType as InterfaceTypeImpl;
758756
addInterfacesToFill(superType.element3);
759757
}
760758

0 commit comments

Comments
 (0)