@@ -668,7 +668,13 @@ void runTests(ResolversFactory resolversFactory) {
668668 },
669669 (resolver) async {
670670 var main = (await resolver.findLibraryByName ('web.main' ))! ;
671- var meta = main.getClass2 ('Foo' )! .supertype! .element.metadata[0 ];
671+ var meta =
672+ main
673+ .getClass2 ('Foo' )!
674+ .supertype!
675+ .element3
676+ .metadata2
677+ .annotations[0 ];
672678 expect (meta, isNotNull);
673679 expect (meta.computeConstantValue ()? .toIntValue (), 0 );
674680 },
@@ -1139,8 +1145,7 @@ int? get x => 1;
11391145 expect (color.type.element! .name, equals ('Color' ));
11401146 expect (color.type.element! .library! .name, equals ('dart.ui' ));
11411147 expect (
1142- color.type.element! .library! .definingCompilationUnit.source.uri
1143- .toString (),
1148+ color.type.element3! .library2! .uri.toString (),
11441149 equals ('dart:ui' ),
11451150 );
11461151 } else {
@@ -1268,7 +1273,7 @@ int? get x => 1;
12681273 );
12691274 expect (unit, isA <FunctionDeclaration >());
12701275 expect (unit! .toSource (), 'main() {}' );
1271- expect ((unit as FunctionDeclaration ).declaredElement , isNull);
1276+ expect ((unit as FunctionDeclaration ).declaredFragment , isNull);
12721277 }, resolvers: createResolvers ());
12731278 });
12741279
@@ -1283,7 +1288,11 @@ int? get x => 1;
12831288 unit,
12841289 isA <FunctionDeclaration >()
12851290 .having ((fd) => fd.toSource (), 'toSource()' , 'main() {}' )
1286- .having ((fd) => fd.declaredElement, 'declaredElement' , isNotNull),
1291+ .having (
1292+ (fd) => fd.declaredFragment,
1293+ 'declaredElement' ,
1294+ isNotNull,
1295+ ),
12871296 );
12881297 }, resolvers: createResolvers ());
12891298 });
@@ -1304,7 +1313,11 @@ int? get x => 1;
13041313 (unit as CompilationUnit ).declarations.single,
13051314 isA <FunctionDeclaration >()
13061315 .having ((fd) => fd.toSource (), 'toSource()' , 'main() {}' )
1307- .having ((fd) => fd.declaredElement, 'declaredElement' , isNotNull),
1316+ .having (
1317+ (fd) => fd.declaredFragment,
1318+ 'declaredFragment' ,
1319+ isNotNull,
1320+ ),
13081321 );
13091322 });
13101323 });
0 commit comments