Skip to content

Commit 3103d85

Browse files
committed
Remove unused TypeSystemImpl.mostSpecificTypeArgument().
[email protected] Change-Id: Ie9adba08c0f5e35e01db680ec3dce078791a9918 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155722 Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 6d9a4f1 commit 3103d85

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -259,30 +259,6 @@ abstract class TypeSystem implements public.TypeSystem {
259259
return inferredTypes;
260260
}
261261

262-
/// Searches the superinterfaces of [type] for implementations of
263-
/// [genericType] and returns the most specific type argument used for that
264-
/// generic type.
265-
///
266-
/// For a more general/robust solution, use [InterfaceTypeImpl.asInstanceOf].
267-
///
268-
/// For example, given [type] `List<int>` and [genericType] `Iterable<T>`,
269-
/// returns [int].
270-
///
271-
/// Returns `null` if [type] does not implement [genericType].
272-
DartType mostSpecificTypeArgument(DartType type, DartType genericType) {
273-
if (type is! InterfaceType) return null;
274-
if (genericType is! InterfaceType) return null;
275-
276-
var asInstanceOf =
277-
type.asInstanceOf((genericType as InterfaceType).element);
278-
279-
if (asInstanceOf != null) {
280-
return asInstanceOf.typeArguments[0];
281-
}
282-
283-
return null;
284-
}
285-
286262
/// Returns a non-nullable version of [type]. This is equivalent to the
287263
/// operation `NonNull` defined in the spec.
288264
@override

0 commit comments

Comments
 (0)