@@ -6,7 +6,6 @@ import 'package:analyzer/dart/analysis/results.dart';
66import 'package:analyzer/dart/analysis/session.dart' ;
77import 'package:analyzer/dart/ast/token.dart' ;
88import 'package:analyzer/dart/ast/visitor.dart' ;
9- import 'package:analyzer/dart/element/element.dart' ;
109import 'package:analyzer/dart/element/element2.dart' ;
1110import 'package:analyzer/error/error.dart' ;
1211import 'package:analyzer/file_system/file_system.dart' ;
@@ -187,15 +186,6 @@ class ElementDeclarationResultImpl
187186
188187 ElementDeclarationResultImpl (
189188 this .fragment, this .node, this .parsedUnit, this .resolvedUnit);
190-
191- @Deprecated ('Use fragment instead' )
192- @override
193- Element get element {
194- if (fragment case Element element) {
195- return element;
196- }
197- throw UnsupportedError ('${fragment .runtimeType }' );
198- }
199189}
200190
201191class ErrorsResultImpl implements ErrorsResult {
@@ -280,12 +270,9 @@ class FileResultImpl extends AnalysisResultImpl implements FileResult {
280270
281271class LibraryElementResultImpl implements LibraryElementResult {
282272 @override
283- final LibraryElementImpl element;
284-
285- LibraryElementResultImpl (this .element);
273+ final LibraryElementImpl element2;
286274
287- @override
288- LibraryElementImpl get element2 => element;
275+ LibraryElementResultImpl (this .element2);
289276}
290277
291278class ParsedLibraryResultImpl extends AnalysisResultImpl
@@ -298,15 +285,6 @@ class ParsedLibraryResultImpl extends AnalysisResultImpl
298285 required this .units,
299286 });
300287
301- @Deprecated ('Use getFragmentDeclaration() instead' )
302- @override
303- ElementDeclarationResultImpl ? getElementDeclaration (Element element) {
304- if (element case Fragment fragment) {
305- return getFragmentDeclaration (fragment);
306- }
307- throw UnsupportedError ('$runtimeType .getElementDeclaration($element )' );
308- }
309-
310288 @Deprecated ('Use getFragmentDeclaration() instead' )
311289 @override
312290 ElementDeclarationResultImpl ? getElementDeclaration2 (Fragment fragment) {
@@ -432,22 +410,9 @@ class ResolvedLibraryResultImpl extends AnalysisResultImpl
432410 required this .units,
433411 });
434412
435- @Deprecated ('Use element2 instead' )
436- @override
437- LibraryElement get element => element2;
438-
439413 @override
440414 TypeProviderImpl get typeProvider => element2.typeProvider;
441415
442- @Deprecated ('Use getFragmentDeclaration() instead' )
443- @override
444- ElementDeclarationResultImpl ? getElementDeclaration (Element element) {
445- if (element case Fragment fragment) {
446- return getFragmentDeclaration (fragment);
447- }
448- throw UnsupportedError ('$runtimeType .getElementDeclaration($element )' );
449- }
450-
451416 @Deprecated ('Use getFragmentDeclaration() instead' )
452417 @override
453418 ElementDeclarationResultImpl ? getElementDeclaration2 (Fragment fragment) {
@@ -512,12 +477,6 @@ class ResolvedUnitResultImpl extends FileResultImpl
512477 @override
513478 bool get exists => fileState.exists;
514479
515- @Deprecated ('Use libraryElement2 instead' )
516- @override
517- LibraryElementImpl get libraryElement {
518- return libraryElement2;
519- }
520-
521480 @override
522481 LibraryElementImpl get libraryElement2 {
523482 return libraryFragment.element;
@@ -536,14 +495,11 @@ class ResolvedUnitResultImpl extends FileResultImpl
536495class UnitElementResultImpl extends FileResultImpl
537496 implements UnitElementResult {
538497 @override
539- final CompilationUnitElementImpl element ;
498+ final CompilationUnitElementImpl fragment ;
540499
541500 UnitElementResultImpl ({
542501 required super .session,
543502 required super .fileState,
544- required this .element ,
503+ required this .fragment ,
545504 });
546-
547- @override
548- CompilationUnitElementImpl get fragment => element;
549505}
0 commit comments