Skip to content

Commit

Permalink
Elements. Changes to support google3 migration.
Browse files Browse the repository at this point in the history
Change-Id: I3244d230632dd237304148f7f62f9719d3ac7c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401982
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
scheglov committed Dec 21, 2024
1 parent facaffc commit 7cc1322
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions pkg/analyzer/lib/dart/element/type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ abstract class InterfaceType implements ParameterizedType {
/// with the given name.
MethodElement? getMethod(String name);

/// Return the element representing the method with the given [name] that is
/// declared in this class, or `null` if this class does not declare a method
/// with the given name.
MethodElement2? getMethod2(String name);

/// Return the element representing the setter with the given [name] that is
/// declared in this class, or `null` if this class does not declare a setter
/// with the given name.
Expand Down
5 changes: 5 additions & 0 deletions pkg/analyzer/lib/src/dart/element/type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,11 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
MethodElement? getMethod(String methodName) =>
MethodMember.from(element.getMethod(methodName), this);

@override
MethodElement2? getMethod2(String methodName) {
return getMethod(methodName)?.asElement2;
}

@override
PropertyAccessorElement? getSetter(String setterName) =>
PropertyAccessorMember.from(element.getSetter(setterName), this);
Expand Down
6 changes: 0 additions & 6 deletions pkg/analyzer/lib/src/utilities/extensions/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,6 @@ extension InterfaceElementExtension on InterfaceElement {
}
}

extension InterfaceTypeExtension on InterfaceType {
MethodElement2? getMethod2(String name) {
return getMethod(name)?.asElement2;
}
}

extension LabelElement2Extension on LabelElement2 {
LabelElement get asElement {
return firstFragment as LabelElement;
Expand Down

0 comments on commit 7cc1322

Please sign in to comment.