Skip to content

Commit b0f1748

Browse files
committed
Elements. Remove V1 ClassElement.
Change-Id: Iafae2a9c8910cb0a9f06d4b378bee1a67fd25b76 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423200 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent eee1cdb commit b0f1748

File tree

4 files changed

+6
-236
lines changed

4 files changed

+6
-236
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,9 +2958,6 @@ package:analyzer/dart/constant/value.dart:
29582958
toSymbolValue (method: String? Function())
29592959
toTypeValue (method: DartType? Function())
29602960
package:analyzer/dart/element/element.dart:
2961-
AugmentedClassElement (class extends Object implements AugmentedInterfaceElement, deprecated):
2962-
new (constructor: AugmentedClassElement Function())
2963-
firstFragment (getter: ClassElement)
29642961
AugmentedEnumElement (class extends Object implements AugmentedInterfaceElement, deprecated):
29652962
new (constructor: AugmentedEnumElement Function())
29662963
constants (getter: List<FieldElement>)
@@ -3003,25 +3000,6 @@ package:analyzer/dart/element/element.dart:
30033000
superclassConstraints (getter: List<InterfaceType>)
30043001
BindPatternVariableElement (class extends Object implements PatternVariableElement, deprecated):
30053002
new (constructor: BindPatternVariableElement Function())
3006-
ClassElement (class extends Object implements InterfaceElement, deprecated):
3007-
new (constructor: ClassElement Function())
3008-
augmented (getter: AugmentedClassElement, deprecated)
3009-
hasNonFinalField (getter: bool)
3010-
isAbstract (getter: bool)
3011-
isBase (getter: bool)
3012-
isConstructable (getter: bool)
3013-
isDartCoreEnum (getter: bool)
3014-
isDartCoreObject (getter: bool)
3015-
isExhaustive (getter: bool)
3016-
isFinal (getter: bool)
3017-
isInterface (getter: bool)
3018-
isMixinApplication (getter: bool)
3019-
isMixinClass (getter: bool)
3020-
isSealed (getter: bool)
3021-
isValidMixin (getter: bool)
3022-
isExtendableIn (method: bool Function(LibraryElement))
3023-
isImplementableIn (method: bool Function(LibraryElement))
3024-
isMixableIn (method: bool Function(LibraryElement))
30253003
ClassMemberElement (class extends Object implements Element, deprecated):
30263004
new (constructor: ClassMemberElement Function())
30273005
enclosingElement3 (getter: Element)
@@ -3030,7 +3008,6 @@ package:analyzer/dart/element/element.dart:
30303008
new (constructor: CompilationUnitElement Function())
30313009
accessibleExtensions (getter: List<ExtensionElement>)
30323010
accessors (getter: List<PropertyAccessorElement>)
3033-
classes (getter: List<ClassElement>)
30343011
enclosingElement3 (getter: CompilationUnitElement?)
30353012
enums (getter: List<EnumElement>)
30363013
extensionTypes (getter: List<ExtensionTypeElement>, experimental)
@@ -3046,7 +3023,6 @@ package:analyzer/dart/element/element.dart:
30463023
session (getter: AnalysisSession)
30473024
topLevelVariables (getter: List<TopLevelVariableElement>)
30483025
typeAliases (getter: List<TypeAliasElement>)
3049-
getClass (method: ClassElement? Function(String))
30503026
getEnum (method: EnumElement? Function(String))
30513027
ConstructorElement (class extends Object implements ClassMemberElement, ExecutableElement, ConstantEvaluationTarget, deprecated):
30523028
new (constructor: ConstructorElement Function())
@@ -3355,7 +3331,6 @@ package:analyzer/dart/element/element.dart:
33553331
typeProvider (getter: TypeProvider)
33563332
typeSystem (getter: TypeSystem)
33573333
units (getter: List<CompilationUnitElement>, deprecated)
3358-
getClass (method: ClassElement? Function(String), deprecated)
33593334
LibraryExportElement (class extends Object implements _ExistingElement, deprecated):
33603335
new (constructor: LibraryExportElement Function())
33613336
combinators (getter: List<NamespaceCombinator>)

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

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,6 @@ import 'package:analyzer/src/task/api/model.dart' show AnalysisTarget;
6060
import 'package:meta/meta.dart';
6161
import 'package:pub_semver/pub_semver.dart';
6262

63-
/// The result of applying augmentations to a [ClassElement].
64-
///
65-
/// Clients may not extend, implement or mix-in this class.
66-
@Deprecated(elementModelDeprecationMsg)
67-
abstract class AugmentedClassElement implements AugmentedInterfaceElement {
68-
@override
69-
ClassElement get firstFragment;
70-
}
71-
7263
/// The result of applying augmentations to an [EnumElement].
7364
///
7465
/// Clients may not extend, implement or mix-in this class.
@@ -247,105 +238,6 @@ abstract class AugmentedMixinElement extends AugmentedInterfaceElement {
247238
'Use BindPatternVariableFragment and BindPatternVariableElement2 instead')
248239
abstract class BindPatternVariableElement implements PatternVariableElement {}
249240

250-
/// An element that represents a class or a mixin. The class can be defined by
251-
/// either a class declaration (with a class body), a mixin application (without
252-
/// a class body), a mixin declaration, or an enum declaration.
253-
///
254-
/// Clients may not extend, implement or mix-in this class.
255-
@Deprecated('Use ClassElement2 instead')
256-
abstract class ClassElement implements InterfaceElement {
257-
@Deprecated(elementModelDeprecationMsg)
258-
@override
259-
AugmentedClassElement get augmented;
260-
261-
/// Whether the class or its superclass declares a non-final instance field.
262-
bool get hasNonFinalField;
263-
264-
/// Whether the class is abstract. A class is abstract if it has an
265-
/// explicit `abstract` modifier. Note, that this definition of
266-
/// <i>abstract</i> is different from <i>has unimplemented members</i>.
267-
bool get isAbstract;
268-
269-
/// Whether this class is a base class.
270-
///
271-
/// A class is a base class if it has an explicit `base` modifier, or the
272-
/// class has a `base` induced modifier and [isSealed] is `true` as well.
273-
/// The base modifier allows the class to be extended but not implemented.
274-
bool get isBase;
275-
276-
/// Whether the class can be instantiated.
277-
bool get isConstructable;
278-
279-
/// Whether the class represents the class 'Enum' defined in `dart:core`.
280-
bool get isDartCoreEnum;
281-
282-
/// Whether the class represents the class 'Object' defined in `dart:core`.
283-
bool get isDartCoreObject;
284-
285-
/// Whether the class has the property where, in a switch, if you cover all
286-
/// of the subtypes of this element, then the compiler knows that you have
287-
/// covered all possible instances of the type.
288-
bool get isExhaustive;
289-
290-
/// Whether the class is a final class.
291-
///
292-
/// A class is a final class if it has an explicit `final` modifier, or the
293-
/// class has a `final` induced modifier and [isSealed] is `true` as well.
294-
/// The final modifier prohibits this class from being extended, implemented,
295-
/// or mixed in.
296-
bool get isFinal;
297-
298-
/// Whether the class is an interface class.
299-
///
300-
/// A class is an interface class if it has an explicit `interface` modifier,
301-
/// or the class has an `interface` induced modifier and [isSealed] is `true`
302-
/// as well. The interface modifier allows the class to be implemented, but
303-
/// not extended or mixed in.
304-
bool get isInterface;
305-
306-
/// Whether the class is a mixin application.
307-
///
308-
/// A class is a mixin application if it was declared using the syntax
309-
/// `class A = B with C;`.
310-
bool get isMixinApplication;
311-
312-
/// Whether the class is a mixin class.
313-
///
314-
/// A class is a mixin class if it has an explicit `mixin` modifier.
315-
bool get isMixinClass;
316-
317-
/// Whether the class is a sealed class.
318-
///
319-
/// A class is a sealed class if it has an explicit `sealed` modifier.
320-
bool get isSealed;
321-
322-
/// Whether the class can validly be used as a mixin when defining
323-
/// another class.
324-
///
325-
/// For classes defined by a class declaration or a mixin application, the
326-
/// behavior of this method is defined by the Dart Language Specification
327-
/// in section 9:
328-
/// <blockquote>
329-
/// It is a compile-time error if a declared or derived mixin refers to super.
330-
/// It is a compile-time error if a declared or derived mixin explicitly
331-
/// declares a constructor. It is a compile-time error if a mixin is derived
332-
/// from a class whose superclass is not Object.
333-
/// </blockquote>
334-
bool get isValidMixin;
335-
336-
/// Whether the class, assuming that it is within scope, is extendable to
337-
/// classes in the given [library].
338-
bool isExtendableIn(LibraryElement library);
339-
340-
/// Whether the class, assuming that it is within scope, is
341-
/// implementable to classes, mixins, and enums in the given [library].
342-
bool isImplementableIn(LibraryElement library);
343-
344-
/// Whether the class, assuming that it is within scope, is able to be
345-
/// mixed-in by classes and enums in the given [library].
346-
bool isMixableIn(LibraryElement library);
347-
}
348-
349241
/// An element that is contained within a [ClassElement].
350242
///
351243
/// Clients may not extend, implement or mix-in this class.
@@ -382,9 +274,6 @@ abstract class CompilationUnitElement implements UriReferencedElement {
382274
/// compilation unit.
383275
List<PropertyAccessorElement> get accessors;
384276

385-
/// The classes declared in this compilation unit.
386-
List<ClassElement> get classes;
387-
388277
/// The [CompilationUnitElement] that uses `part` directive to include this
389278
/// element, or `null` if this element is the defining unit of the library.
390279
@override
@@ -438,11 +327,6 @@ abstract class CompilationUnitElement implements UriReferencedElement {
438327
/// The type aliases declared in this compilation unit.
439328
List<TypeAliasElement> get typeAliases;
440329

441-
/// Returns the class defined in this compilation unit that has the given
442-
/// [name], or `null` if this compilation unit does not define a class with
443-
/// the given name.
444-
ClassElement? getClass(String name);
445-
446330
/// Returns the enum defined in this compilation unit that has the given
447331
/// [name], or `null` if this compilation unit does not define an enum with
448332
/// the given name.
@@ -1855,11 +1739,6 @@ abstract class LibraryElement implements _ExistingElement {
18551739
/// `part` directive.
18561740
@Deprecated(elementModelDeprecationMsg)
18571741
List<CompilationUnitElement> get units;
1858-
1859-
/// The class defined in this library that has the given [name], or
1860-
/// `null` if this library does not define a class with the given name.
1861-
@Deprecated(elementModelDeprecationMsg)
1862-
ClassElement? getClass(String name);
18631742
}
18641743

18651744
/// A single export directive within a library.

0 commit comments

Comments
 (0)