Skip to content

Commit 7cc1322

Browse files
committed
Elements. Changes to support google3 migration.
Change-Id: I3244d230632dd237304148f7f62f9719d3ac7c11 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401982 Reviewed-by: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent facaffc commit 7cc1322

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

pkg/analyzer/lib/dart/element/type.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ abstract class InterfaceType implements ParameterizedType {
385385
/// with the given name.
386386
MethodElement? getMethod(String name);
387387

388+
/// Return the element representing the method with the given [name] that is
389+
/// declared in this class, or `null` if this class does not declare a method
390+
/// with the given name.
391+
MethodElement2? getMethod2(String name);
392+
388393
/// Return the element representing the setter with the given [name] that is
389394
/// declared in this class, or `null` if this class does not declare a setter
390395
/// with the given name.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,11 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
905905
MethodElement? getMethod(String methodName) =>
906906
MethodMember.from(element.getMethod(methodName), this);
907907

908+
@override
909+
MethodElement2? getMethod2(String methodName) {
910+
return getMethod(methodName)?.asElement2;
911+
}
912+
908913
@override
909914
PropertyAccessorElement? getSetter(String setterName) =>
910915
PropertyAccessorMember.from(element.getSetter(setterName), this);

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,6 @@ extension InterfaceElementExtension on InterfaceElement {
375375
}
376376
}
377377

378-
extension InterfaceTypeExtension on InterfaceType {
379-
MethodElement2? getMethod2(String name) {
380-
return getMethod(name)?.asElement2;
381-
}
382-
}
383-
384378
extension LabelElement2Extension on LabelElement2 {
385379
LabelElement get asElement {
386380
return firstFragment as LabelElement;

0 commit comments

Comments
 (0)