Skip to content

Commit 7cb48f8

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 getters from InterfaceType.
Change-Id: I3a8827b8bee876b326a58ade17c580ea7783c1f9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423364 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 6a324ac commit 7cb48f8

File tree

3 files changed

+0
-178
lines changed

3 files changed

+0
-178
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,30 +4169,22 @@ package:analyzer/dart/element/type.dart:
41694169
typeArguments (getter: List<DartType>)
41704170
InterfaceType (class extends Object implements ParameterizedType):
41714171
new (constructor: InterfaceType Function())
4172-
accessors (getter: List<PropertyAccessorElement>, deprecated)
41734172
allSupertypes (getter: List<InterfaceType>)
41744173
constructors2 (getter: List<ConstructorElement2>, experimental)
41754174
element3 (getter: InterfaceElement2, experimental)
41764175
getters (getter: List<GetterElement>, experimental)
41774176
interfaces (getter: List<InterfaceType>)
4178-
methods (getter: List<MethodElement>, deprecated)
41794177
methods2 (getter: List<MethodElement2>, experimental)
41804178
mixins (getter: List<InterfaceType>)
41814179
setters (getter: List<SetterElement>, experimental)
41824180
superclass (getter: InterfaceType?)
41834181
superclassConstraints (getter: List<InterfaceType>)
4184-
getGetter (method: PropertyAccessorElement? Function(String), deprecated)
41854182
getGetter2 (method: GetterElement? Function(String))
4186-
getMethod (method: MethodElement? Function(String), deprecated)
41874183
getMethod2 (method: MethodElement2? Function(String))
4188-
getSetter (method: PropertyAccessorElement? Function(String), deprecated)
41894184
getSetter2 (method: SetterElement? Function(String))
41904185
lookUpConstructor2 (method: ConstructorElement2? Function(String?, LibraryElement2))
4191-
lookUpGetter2 (method: PropertyAccessorElement? Function(String, LibraryElement, {bool concrete, bool inherited, bool recoveryStatic}), deprecated)
41924186
lookUpGetter3 (method: GetterElement? Function(String, LibraryElement2, {bool concrete, bool inherited, bool recoveryStatic}))
4193-
lookUpMethod2 (method: MethodElement? Function(String, LibraryElement, {bool concrete, bool inherited, bool recoveryStatic}), deprecated)
41944187
lookUpMethod3 (method: MethodElement2? Function(String, LibraryElement2, {bool concrete, bool inherited, bool recoveryStatic}))
4195-
lookUpSetter2 (method: PropertyAccessorElement? Function(String, LibraryElement, {bool concrete, bool inherited, bool recoveryStatic}), deprecated)
41964188
lookUpSetter3 (method: SetterElement? Function(String, LibraryElement2, {bool concrete, bool inherited, bool recoveryStatic}))
41974189
InvalidType (class extends Object implements DartType):
41984190
new (constructor: InvalidType Function())

pkg/analyzer/lib/dart/element/type.dart

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,6 @@ abstract class InstantiatedTypeAliasElement {
316316
///
317317
/// Clients may not extend, implement or mix-in this class.
318318
abstract class InterfaceType implements ParameterizedType {
319-
/// Return a list containing all of the accessors (getters and setters)
320-
/// declared in this type.
321-
@Deprecated('Use getters or setters instead')
322-
List<PropertyAccessorElement> get accessors;
323-
324319
/// Return all the super-interfaces implemented by this interface. This
325320
/// includes superclasses, mixins, interfaces, and superclass constraints.
326321
List<InterfaceType> get allSupertypes;
@@ -343,10 +338,6 @@ abstract class InterfaceType implements ParameterizedType {
343338
/// by this method will have had their type parameters replaced.
344339
List<InterfaceType> get interfaces;
345340

346-
/// Return a list containing all of the methods declared in this type.
347-
@Deprecated('Use methods2 instead')
348-
List<MethodElement> get methods;
349-
350341
/// Return a list containing all of the methods declared in this type.
351342
@experimental
352343
List<MethodElement2> get methods2;
@@ -374,34 +365,16 @@ abstract class InterfaceType implements ParameterizedType {
374365
/// represent a mixin declaration.
375366
List<InterfaceType> get superclassConstraints;
376367

377-
/// Return the element representing the getter with the given [name] that is
378-
/// declared in this class, or `null` if this class does not declare a getter
379-
/// with the given name.
380-
@Deprecated('Use getGetter2() instead')
381-
PropertyAccessorElement? getGetter(String name);
382-
383368
/// Return the element representing the getter with the given [name] that is
384369
/// declared in this class, or `null` if this class does not declare a getter
385370
/// with the given name.
386371
GetterElement? getGetter2(String name);
387372

388-
/// Return the element representing the method with the given [name] that is
389-
/// declared in this class, or `null` if this class does not declare a method
390-
/// with the given name.
391-
@Deprecated('Use getMethod2() instead')
392-
MethodElement? getMethod(String name);
393-
394373
/// Return the element representing the method with the given [name] that is
395374
/// declared in this class, or `null` if this class does not declare a method
396375
/// with the given name.
397376
MethodElement2? getMethod2(String name);
398377

399-
/// Return the element representing the setter with the given [name] that is
400-
/// declared in this class, or `null` if this class does not declare a setter
401-
/// with the given name.
402-
@Deprecated('Use getSetter2() instead')
403-
PropertyAccessorElement? getSetter(String name);
404-
405378
/// Return the element representing the setter with the given [name] that is
406379
/// declared in this class, or `null` if this class does not declare a setter
407380
/// with the given name.
@@ -420,25 +393,6 @@ abstract class InterfaceType implements ParameterizedType {
420393
ConstructorElement2? lookUpConstructor2(
421394
String? name, LibraryElement2 library);
422395

423-
/// Return the getter with the given [name].
424-
///
425-
/// If [concrete] is `true`, then the concrete implementation is returned,
426-
/// from this type, or its superclass.
427-
///
428-
/// If [inherited] is `true`, then only getters from the superclass are
429-
/// considered.
430-
///
431-
/// If [recoveryStatic] is `true`, then static getters of the class,
432-
/// and its superclasses are considered. Clients should not use it.
433-
@Deprecated('Use lookUpGetter3() instead')
434-
PropertyAccessorElement? lookUpGetter2(
435-
String name,
436-
LibraryElement library, {
437-
bool concrete = false,
438-
bool inherited = false,
439-
bool recoveryStatic = false,
440-
});
441-
442396
/// Return the getter with the given [name].
443397
///
444398
/// If [concrete] is `true`, then the concrete implementation is returned,
@@ -457,25 +411,6 @@ abstract class InterfaceType implements ParameterizedType {
457411
bool recoveryStatic = false,
458412
});
459413

460-
/// Return the method with the given [name].
461-
///
462-
/// If [concrete] is `true`, then the concrete implementation is returned,
463-
/// from this type, or its superclass.
464-
///
465-
/// If [inherited] is `true`, then only methods from the superclass are
466-
/// considered.
467-
///
468-
/// If [recoveryStatic] is `true`, then static methods of the class,
469-
/// and its superclasses are considered. Clients should not use it.
470-
@Deprecated('Use lookUpMethod3() instead')
471-
MethodElement? lookUpMethod2(
472-
String name,
473-
LibraryElement library, {
474-
bool concrete = false,
475-
bool inherited = false,
476-
bool recoveryStatic = false,
477-
});
478-
479414
/// Return the method with the given [name].
480415
///
481416
/// If [concrete] is `true`, then the concrete implementation is returned,
@@ -494,25 +429,6 @@ abstract class InterfaceType implements ParameterizedType {
494429
bool recoveryStatic = false,
495430
});
496431

497-
/// Return the setter with the given [name].
498-
///
499-
/// If [concrete] is `true`, then the concrete implementation is returned,
500-
/// from this type, or its superclass.
501-
///
502-
/// If [inherited] is `true`, then only setters from the superclass are
503-
/// considered.
504-
///
505-
/// If [recoveryStatic] is `true`, then static setters of the class,
506-
/// and its superclasses are considered. Clients should not use it.
507-
@Deprecated('Use lookUpSetter3() instead')
508-
PropertyAccessorElement? lookUpSetter2(
509-
String name,
510-
LibraryElement library, {
511-
bool concrete = false,
512-
bool inherited = false,
513-
bool recoveryStatic = false,
514-
});
515-
516432
/// Return the setter with the given [name].
517433
///
518434
/// If [concrete] is `true`, then the concrete implementation is returned,

pkg/analyzer/lib/src/dart/element/type.dart

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import 'package:_fe_analyzer_shared/src/types/shared_type.dart';
66
import 'package:analyzer/dart/ast/token.dart';
7-
import 'package:analyzer/dart/element/element.dart';
87
import 'package:analyzer/dart/element/element2.dart';
98
import 'package:analyzer/dart/element/nullability_suffix.dart';
109
import 'package:analyzer/dart/element/type.dart';
@@ -17,7 +16,6 @@ import 'package:analyzer/src/dart/element/type_algebra.dart';
1716
import 'package:analyzer/src/dart/element/type_system.dart';
1817
import 'package:analyzer/src/utilities/extensions/collection.dart';
1918
import 'package:analyzer/src/utilities/extensions/element.dart';
20-
import 'package:analyzer/src/utilities/extensions/object.dart';
2119
import 'package:collection/collection.dart';
2220

2321
/// Returns a [List] of fixed length with given types.
@@ -621,12 +619,6 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
621619
assert(this is NullTypeImpl);
622620
}
623621

624-
@Deprecated('Use getters / setters instead')
625-
@override
626-
List<PropertyAccessorElementOrMember> get accessors {
627-
return [...getters, ...setters].map((e) => e.asElement).toList();
628-
}
629-
630622
@override
631623
List<InterfaceTypeImpl> get allSupertypes {
632624
var substitution = Substitution.fromInterfaceType(this);
@@ -747,12 +739,6 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
747739
return element3.name3 == "Type" && element3.library2.isDartCore;
748740
}
749741

750-
@Deprecated('Use methods2 instead')
751-
@override
752-
List<MethodElementOrMember> get methods {
753-
return methods2.map((e) => e.asElement).toList();
754-
}
755-
756742
@override
757743
List<MethodElement2OrMember> get methods2 {
758744
return _methods ??= element3.methods2.map((e) {
@@ -863,36 +849,18 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
863849
return null;
864850
}
865851

866-
@Deprecated('Use getGetter2() instead')
867-
@override
868-
PropertyAccessorElementOrMember? getGetter(String getterName) {
869-
return getGetter2(getterName)?.asElement;
870-
}
871-
872852
@override
873853
GetterElement2OrMember? getGetter2(String getterName) {
874854
var element = element3.getGetter2(getterName);
875855
return element != null ? GetterMember.from(element, this) : null;
876856
}
877857

878-
@Deprecated('Use getMethod2() instead')
879-
@override
880-
MethodElementOrMember? getMethod(String methodName) {
881-
return getMethod2(methodName)?.asElement;
882-
}
883-
884858
@override
885859
MethodElement2OrMember? getMethod2(String methodName) {
886860
var element = element3.getMethod2(methodName);
887861
return element != null ? MethodMember.from2(element, this) : null;
888862
}
889863

890-
@Deprecated('Use getSetter2() instead')
891-
@override
892-
PropertyAccessorElement? getSetter(String setterName) {
893-
return getSetter2(setterName)?.asElement;
894-
}
895-
896864
@override
897865
SetterElement2OrMember? getSetter2(String setterName) {
898866
var element = element3.getSetter2(setterName);
@@ -918,24 +886,6 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
918886
return ConstructorMember.from2(constructorElement, this);
919887
}
920888

921-
@Deprecated('Use lookUpGetter3() instead')
922-
@override
923-
PropertyAccessorElement? lookUpGetter2(
924-
String name,
925-
covariant LibraryElementImpl library, {
926-
bool concrete = false,
927-
bool inherited = false,
928-
bool recoveryStatic = false,
929-
}) {
930-
return lookUpGetter3(
931-
name,
932-
library,
933-
concrete: concrete,
934-
inherited: inherited,
935-
recoveryStatic: recoveryStatic,
936-
)?.asElement;
937-
}
938-
939889
@override
940890
GetterElement2OrMember? lookUpGetter3(
941891
String name,
@@ -974,24 +924,6 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
974924
return null;
975925
}
976926

977-
@Deprecated('Use lookUpMethod3() instead')
978-
@override
979-
MethodElementOrMember? lookUpMethod2(
980-
String name,
981-
covariant LibraryElementImpl library, {
982-
bool concrete = false,
983-
bool inherited = false,
984-
bool recoveryStatic = false,
985-
}) {
986-
return lookUpMethod3(
987-
name,
988-
library,
989-
concrete: concrete,
990-
inherited: inherited,
991-
recoveryStatic: recoveryStatic,
992-
)?.asElement;
993-
}
994-
995927
@override
996928
MethodElement2OrMember? lookUpMethod3(
997929
String name,
@@ -1030,24 +962,6 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
1030962
return null;
1031963
}
1032964

1033-
@Deprecated('Use lookUpSetter3() instead')
1034-
@override
1035-
PropertyAccessorElement? lookUpSetter2(
1036-
String name,
1037-
covariant LibraryElementImpl library, {
1038-
bool concrete = false,
1039-
bool inherited = false,
1040-
bool recoveryStatic = false,
1041-
}) {
1042-
return lookUpSetter3(
1043-
name,
1044-
library,
1045-
concrete: concrete,
1046-
inherited: inherited,
1047-
recoveryStatic: recoveryStatic,
1048-
)?.asElement.ifTypeOrNull();
1049-
}
1050-
1051965
@override
1052966
SetterElement2OrMember? lookUpSetter3(
1053967
String name,

0 commit comments

Comments
 (0)