File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1325,6 +1325,25 @@ abstract class InterfaceElement2 implements InstanceElement2 {
1325
1325
required NullabilitySuffix nullabilitySuffix,
1326
1326
});
1327
1327
1328
+ /// Returns the element representing the method that results from looking up
1329
+ /// the given [methodName] in this class with respect to the given [library] ,
1330
+ /// ignoring abstract methods, or `null` if the look up fails.
1331
+ ///
1332
+ /// The behavior of this method is defined by the Dart Language Specification
1333
+ /// in section 16.15.1:
1334
+ /// <blockquote>
1335
+ /// The result of looking up method <i>m</i> in class <i>C</i> with respect to
1336
+ /// library <i>L</i> is: If <i>C</i> declares an instance method named
1337
+ /// <i>m</i> that is accessible to <i>L</i>, then that method is the result of
1338
+ /// the lookup. Otherwise, if <i>C</i> has a superclass <i>S</i>, then the
1339
+ /// result of the lookup is the result of looking up method <i>m</i> in
1340
+ /// <i>S</i> with respect to <i>L</i>. Otherwise, we say that the lookup has
1341
+ /// failed.
1342
+ /// </blockquote>
1343
+ // TODO(scheglov): Deprecate and remove it.
1344
+ MethodElement2 ? lookUpConcreteMethod (
1345
+ String methodName, LibraryElement2 library);
1346
+
1328
1347
/// Returns the element representing the method that results from looking up
1329
1348
/// the given [methodName] in the superclass of this class with respect to the
1330
1349
/// given [library] , or `null` if the look up fails.
Original file line number Diff line number Diff line change @@ -6447,6 +6447,13 @@ abstract class InterfaceElementImpl2 extends InstanceElementImpl2
6447
6447
firstFragment.instantiate (
6448
6448
typeArguments: typeArguments, nullabilitySuffix: nullabilitySuffix);
6449
6449
6450
+ @override
6451
+ MethodElement2 ? lookUpConcreteMethod (
6452
+ String methodName, LibraryElement2 library) {
6453
+ return _implementationsOfMethod2 (methodName).firstWhereOrNull (
6454
+ (method) => ! method.isAbstract && method.isAccessibleIn2 (library));
6455
+ }
6456
+
6450
6457
PropertyAccessorElement2 ? lookUpInheritedConcreteGetter (
6451
6458
String getterName, LibraryElement2 library) {
6452
6459
return _implementationsOfGetter2 (getterName).firstWhereOrNull ((getter) =>
You can’t perform that action at this time.
0 commit comments