55import 'package:analyzer/dart/analysis/features.dart' ;
66import 'package:analyzer/src/error/codes.dart' ;
77import 'package:analyzer/src/generated/engine.dart' ;
8- import 'package:test/test.dart' ;
98import 'package:test_reflective_loader/test_reflective_loader.dart' ;
109
1110import 'driver_resolution.dart' ;
5756''' );
5857
5958 var invocation = findNode.methodInvocation ('c.a()' );
60- expect (invocation.methodName.staticElement.library.isDartCore, isFalse );
59+ assertElement (invocation, findElement. method ( 'a' , of : 'Core2_Ext' ) );
6160 }
6261
6362 test_method_noMatch () async {
@@ -111,8 +110,7 @@ f() {
111110''' );
112111
113112 var invocation = findNode.methodInvocation ('b.a()' );
114- var declaration = findNode.methodDeclaration ('void a()' );
115- expect (invocation.methodName.staticElement, declaration.declaredElement);
113+ assertElement (invocation, findElement.method ('a' ));
116114 }
117115
118116 test_method_privateExtension () async {
@@ -161,7 +159,7 @@ extension A_Ext on A {
161159}
162160
163161extension B_Ext on B {
164- void /*2*/ a() { }
162+ void a() { }
165163}
166164
167165f() {
@@ -171,8 +169,7 @@ f() {
171169''' );
172170
173171 var invocation = findNode.methodInvocation ('b.a()' );
174- var declaration = findNode.methodDeclaration ('void /*2*/ a()' );
175- expect (invocation.methodName.staticElement, declaration.declaredElement);
172+ assertElement (invocation, findElement.method ('a' , of: 'B_Ext' ));
176173 }
177174
178175 @failingTest
@@ -189,7 +186,7 @@ extension A_Ext<T> on A<T> {
189186}
190187
191188extension B_Ext<T> on B<T> {
192- void /*2*/ f(T x) { }
189+ void f(T x) { }
193190}
194191
195192main() {
@@ -200,8 +197,7 @@ main() {
200197''' );
201198
202199 var invocation = findNode.methodInvocation ('x.f(o)' );
203- var declaration = findNode.methodDeclaration ('void /*2*/ f(T x)' );
204- expect (invocation.methodName.staticElement, declaration.declaredElement);
200+ assertElement (invocation, findElement.method ('f' , of: 'B_Ext' ));
205201 }
206202
207203 test_method_specificSubtypeMatchPlatform () async {
@@ -221,7 +217,7 @@ extension Core_Ext on Core {
221217}
222218
223219extension Core2_Ext on Core2 {
224- void /*2*/ a() => 0;
220+ void a() => 0;
225221}
226222
227223f() {
@@ -231,8 +227,7 @@ f() {
231227''' );
232228
233229 var invocation = findNode.methodInvocation ('c.a()' );
234- var declaration = findNode.methodDeclaration ('void /*2*/ a()' );
235- expect (invocation.methodName.staticElement, declaration.declaredElement);
230+ assertElement (invocation, findElement.method ('a' , of: 'Core2_Ext' ));
236231 }
237232
238233 test_method_unnamedExtension () async {
0 commit comments