@@ -78,31 +78,12 @@ abstract class TypeChecker {
7878 return results.isEmpty ? null : results.first;
7979 }
8080
81- /// Returns the first constant annotating [element] assignable to this type.
82- ///
83- /// Otherwise returns `null` .
84- ///
85- /// Throws on unresolved annotations unless [throwOnUnresolved] is `false` .
86- @Deprecated ('use firstAnnotationOf instead' )
87- DartObject ? firstAnnotationOf2 (
88- Object element, {
89- bool throwOnUnresolved = true ,
90- }) =>
91- firstAnnotationOf (element, throwOnUnresolved: throwOnUnresolved);
92-
9381 /// Returns if a constant annotating [element] is assignable to this type.
9482 ///
9583 /// Throws on unresolved annotations unless [throwOnUnresolved] is `false` .
9684 bool hasAnnotationOf (Element2 element, {bool throwOnUnresolved = true }) =>
9785 firstAnnotationOf (element, throwOnUnresolved: throwOnUnresolved) != null ;
9886
99- /// Returns if a constant annotating [element] is assignable to this type.
100- ///
101- /// Throws on unresolved annotations unless [throwOnUnresolved] is `false` .
102- @Deprecated ('use hasAnnotationOf instead' )
103- bool hasAnnotationOf2 (Element2 element, {bool throwOnUnresolved = true }) =>
104- hasAnnotationOf (element, throwOnUnresolved: throwOnUnresolved);
105-
10687 /// Returns the first constant annotating [element] that is exactly this type.
10788 ///
10889 /// Throws [UnresolvedAnnotationException] on unresolved annotations unless
@@ -125,17 +106,6 @@ abstract class TypeChecker {
125106 return null ;
126107 }
127108
128- /// Returns the first constant annotating [element] that is exactly this type.
129- ///
130- /// Throws [UnresolvedAnnotationException] on unresolved annotations unless
131- /// [throwOnUnresolved] is explicitly set to `false` (default is `true` ).
132- @Deprecated ('use firstAnnotationOfExact instead' )
133- DartObject ? firstAnnotationOfExact2 (
134- Element2 element, {
135- bool throwOnUnresolved = true ,
136- }) =>
137- firstAnnotationOfExact (element, throwOnUnresolved: throwOnUnresolved);
138-
139109 /// Returns if a constant annotating [element] is exactly this type.
140110 ///
141111 /// Throws [UnresolvedAnnotationException] on unresolved annotations unless
@@ -147,17 +117,6 @@ abstract class TypeChecker {
147117 firstAnnotationOfExact (element, throwOnUnresolved: throwOnUnresolved) !=
148118 null ;
149119
150- /// Returns if a constant annotating [element] is exactly this type.
151- ///
152- /// Throws [UnresolvedAnnotationException] on unresolved annotations unless
153- /// [throwOnUnresolved] is explicitly set to `false` (default is `true` ).
154- @Deprecated ('use hasAnnotationOfExact instead' )
155- bool hasAnnotationOfExact2 (
156- Element2 element, {
157- bool throwOnUnresolved = true ,
158- }) =>
159- hasAnnotationOfExact (element, throwOnUnresolved: throwOnUnresolved);
160-
161120 DartObject ? _computeConstantValue (
162121 Object element,
163122 ElementAnnotation annotation,
@@ -185,17 +144,6 @@ abstract class TypeChecker {
185144 throwOnUnresolved: throwOnUnresolved,
186145 );
187146
188- /// Returns annotating constants on [element] assignable to this type.
189- ///
190- /// Throws [UnresolvedAnnotationException] on unresolved annotations unless
191- /// [throwOnUnresolved] is explicitly set to `false` (default is `true` ).
192- @Deprecated ('use annotationsOf instead' )
193- Iterable <DartObject > annotationsOf2 (
194- Object element, {
195- bool throwOnUnresolved = true ,
196- }) =>
197- annotationsOf (element, throwOnUnresolved: throwOnUnresolved);
198-
199147 Iterable <DartObject > _annotationsWhere (
200148 Object element,
201149 bool Function (DartType ) predicate, {
@@ -231,27 +179,12 @@ abstract class TypeChecker {
231179 throwOnUnresolved: throwOnUnresolved,
232180 );
233181
234- /// Returns annotating constants on [element] of exactly this type.
235- ///
236- /// Throws [UnresolvedAnnotationException] on unresolved annotations unless
237- /// [throwOnUnresolved] is explicitly set to `false` (default is `true` ).
238- @Deprecated ('use annotationsOfExact instead' )
239- Iterable <DartObject > annotationsOfExact2 (
240- Element2 element, {
241- bool throwOnUnresolved = true ,
242- }) =>
243- annotationsOfExact (element, throwOnUnresolved: throwOnUnresolved);
244-
245182 /// Returns `true` if the type of [element] can be assigned to this type.
246183 bool isAssignableFrom (Element2 element) =>
247184 isExactly (element) ||
248185 (element is InterfaceElement2 &&
249186 element.allSupertypes.any (isExactlyType));
250187
251- /// Returns `true` if the type of [element] can be assigned to this type.
252- @Deprecated ('use isAssignableFrom instead' )
253- bool isAssignableFrom2 (Element2 element) => isAssignableFrom (element);
254-
255188 /// Returns `true` if [staticType] can be assigned to this type.
256189 bool isAssignableFromType (DartType staticType) {
257190 final element = staticType.element3;
@@ -261,10 +194,6 @@ abstract class TypeChecker {
261194 /// Returns `true` if representing the exact same class as [element] .
262195 bool isExactly (Element2 element);
263196
264- /// Returns `true` if representing the exact same class as [element] .
265- @Deprecated ('use isExactly instead' )
266- bool isExactly2 (Element2 element) => isExactly (element);
267-
268197 /// Returns `true` if representing the exact same type as [staticType] .
269198 ///
270199 /// This will always return false for types without a backingclass such as
@@ -298,13 +227,6 @@ abstract class TypeChecker {
298227 return false ;
299228 }
300229
301- /// Returns `true` if representing a super class of [element] .
302- ///
303- /// This check only takes into account the *extends* hierarchy. If you wish
304- /// to check mixins and interfaces, use [isAssignableFrom] .
305- @Deprecated ('use isSuperOf instead' )
306- bool isSuperOf2 (Element2 element) => isSuperOf (element);
307-
308230 /// Returns `true` if representing a super type of [staticType] .
309231 ///
310232 /// This only takes into account the *extends* hierarchy. If you wish
@@ -322,10 +244,6 @@ class _LibraryTypeChecker extends TypeChecker {
322244 bool isExactly (Element2 element) =>
323245 element is InterfaceElement2 && element == _type.element3;
324246
325- @Deprecated ('Use isExactly() instead' )
326- @override
327- bool isExactly2 (Element2 element) => isExactly (element);
328-
329247 @override
330248 String toString () => urlOfElement (_type.element3! );
331249}
@@ -349,10 +267,6 @@ class _MirrorTypeChecker extends TypeChecker {
349267 @override
350268 bool isExactly (Element2 element) => _computed.isExactly (element);
351269
352- @Deprecated ('use isExactly instead' )
353- @override
354- bool isExactly2 (Element2 element) => isExactly (element);
355-
356270 @override
357271 String toString () => _computed.toString ();
358272}
@@ -385,10 +299,6 @@ class _UriTypeChecker extends TypeChecker {
385299 @override
386300 bool isExactly (Element2 element) => hasSameUrl (urlOfElement (element));
387301
388- @Deprecated ('use isExactly instead' )
389- @override
390- bool isExactly2 (Element2 element) => isExactly (element);
391-
392302 @override
393303 String toString () => '$uri ' ;
394304}
@@ -401,10 +311,6 @@ class _AnyChecker extends TypeChecker {
401311 @override
402312 bool isExactly (Element2 element) =>
403313 _checkers.any ((c) => c.isExactly (element));
404-
405- @Deprecated ('use isExactly2 instead' )
406- @override
407- bool isExactly2 (Element2 element) => isExactly (element);
408314}
409315
410316/// Exception thrown when [TypeChecker] fails to resolve a metadata annotation.
@@ -422,9 +328,6 @@ class UnresolvedAnnotationException implements Exception {
422328 /// May be `null` if the import library was not found.
423329 final SourceSpan ? annotationSource;
424330
425- @Deprecated ('use annotatedElement instead' )
426- Element2 get annotatedElement2 => annotatedElement;
427-
428331 static SourceSpan ? _findSpan (Element2 annotatedElement, int annotationIndex) {
429332 try {
430333 final parsedLibrary =
0 commit comments