Skip to content

Commit a86bb02

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 MixinElement.
Change-Id: I220636152100b901c4100fc1d0558a1b7ebf1c7d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423163 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 9756c7a commit a86bb02

File tree

3 files changed

+1
-99
lines changed

3 files changed

+1
-99
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,6 @@ package:analyzer/dart/element/element.dart:
30123012
libraryImportPrefixes (getter: List<PrefixElement>)
30133013
libraryImports (getter: List<LibraryImportElement>)
30143014
lineInfo (getter: LineInfo)
3015-
mixins (getter: List<MixinElement>)
30163015
parts (getter: List<PartElement>)
30173016
scope (getter: Scope)
30183017
session (getter: AnalysisSession)
@@ -3352,12 +3351,6 @@ package:analyzer/dart/element/element.dart:
33523351
MethodElement (class extends Object implements ClassMemberElement, ExecutableElement, deprecated):
33533352
new (constructor: MethodElement Function())
33543353
declaration (getter: MethodElement)
3355-
MixinElement (class extends Object implements InterfaceElement, deprecated):
3356-
new (constructor: MixinElement Function())
3357-
augmented (getter: AugmentedMixinElement, deprecated)
3358-
isBase (getter: bool)
3359-
superclassConstraints (getter: List<InterfaceType>)
3360-
isImplementableIn (method: bool Function(LibraryElement))
33613354
MultiplyDefinedElement (class extends Object implements Element, deprecated):
33623355
new (constructor: MultiplyDefinedElement Function())
33633356
conflictingElements (getter: List<Element>)

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

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,6 @@ abstract class CompilationUnitElement implements UriReferencedElement {
291291
/// The [LineInfo] for the [source].
292292
LineInfo get lineInfo;
293293

294-
/// The mixins declared in this compilation unit.
295-
List<MixinElement> get mixins;
296-
297294
/// The parts included by this unit.
298295
List<PartElement> get parts;
299296

@@ -1811,38 +1808,6 @@ abstract class MethodElement implements ClassMemberElement, ExecutableElement {
18111808
MethodElement get declaration;
18121809
}
18131810

1814-
/// An element that represents a mixin.
1815-
///
1816-
/// Clients may not extend, implement or mix-in this class.
1817-
@Deprecated('Use MixinElement2 instead')
1818-
abstract class MixinElement implements InterfaceElement {
1819-
@Deprecated(elementModelDeprecationMsg)
1820-
@override
1821-
AugmentedMixinElement get augmented;
1822-
1823-
/// Whether the mixin is a base mixin.
1824-
///
1825-
/// A mixin is a base mixin if it has an explicit `base` modifier.
1826-
/// The base modifier allows a mixin to be mixed in, but not implemented.
1827-
bool get isBase;
1828-
1829-
/// The superclass constraints defined for this mixin.
1830-
///
1831-
/// If the declaration does not have an `on` clause, then the list will
1832-
/// contain the type for the class `Object`.
1833-
///
1834-
/// <b>Note:</b> Because the element model represents the state of the code,
1835-
/// it is possible for it to be semantically invalid. In particular, it is not
1836-
/// safe to assume that the inheritance structure of a class does not contain
1837-
/// a cycle. Clients that traverse the inheritance structure must explicitly
1838-
/// guard against infinite loops.
1839-
List<InterfaceType> get superclassConstraints;
1840-
1841-
/// Whether the element, assuming that it is within scope, is
1842-
/// implementable to classes, mixins, and enums in the given [library].
1843-
bool isImplementableIn(LibraryElement library);
1844-
}
1845-
18461811
/// A pseudo-element that represents multiple elements defined within a single
18471812
/// scope that have the same name. This situation is not allowed by the
18481813
/// language, so objects implementing this interface always represent an error.

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

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,6 @@ class AugmentedInterfaceElementImpl extends AugmentedInstanceElementImpl
228228
}
229229
}
230230

231-
@Deprecated(elementModelDeprecationMsg)
232-
class AugmentedMixinElementImpl extends AugmentedInterfaceElementImpl
233-
implements AugmentedMixinElement {
234-
AugmentedMixinElementImpl(super.firstFragment);
235-
236-
@override
237-
MixinElementImpl get firstFragment {
238-
return super.firstFragment as MixinElementImpl;
239-
}
240-
241-
@override
242-
List<InterfaceType> get superclassConstraints =>
243-
firstFragment.superclassConstraints;
244-
}
245-
246231
class BindPatternVariableElementImpl extends PatternVariableElementImpl
247232
implements
248233
// ignore: deprecated_member_use_from_same_package,analyzer_use_new_elements
@@ -1160,7 +1145,6 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
11601145
return super.metadata;
11611146
}
11621147

1163-
@override
11641148
List<MixinElementImpl> get mixins {
11651149
return _mixins;
11661150
}
@@ -1288,19 +1272,6 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
12881272
builder.writeCompilationUnitElement(this);
12891273
}
12901274

1291-
/// Returns the mixin defined in this compilation unit that has the given
1292-
/// [name], or `null` if this compilation unit does not define a mixin with
1293-
/// the given name.
1294-
@Deprecated(elementModelDeprecationMsg)
1295-
MixinElement? getMixin(String name) {
1296-
for (var mixin in mixins) {
1297-
if (mixin.name == name) {
1298-
return mixin;
1299-
}
1300-
}
1301-
return null;
1302-
}
1303-
13041275
void setLinkedData(Reference reference, ElementLinkedData linkedData) {
13051276
this.reference = reference;
13061277
reference.element = this;
@@ -7532,17 +7503,6 @@ class LibraryElementImpl extends ElementImpl
75327503
return _getElementByName(getters, name);
75337504
}
75347505

7535-
@Deprecated(elementModelDeprecationMsg)
7536-
MixinElement? getMixin(String name) {
7537-
for (var unitElement in units) {
7538-
var element = unitElement.getMixin(name);
7539-
if (element != null) {
7540-
return element;
7541-
}
7542-
}
7543-
return null;
7544-
}
7545-
75467506
@override
75477507
MixinElement2? getMixin2(String name) {
75487508
return _getElementByName(mixins, name);
@@ -8589,10 +8549,7 @@ abstract class MethodElementOrMember
85898549

85908550
/// A [ClassElementImpl] representing a mixin declaration.
85918551
class MixinElementImpl extends ClassOrMixinElementImpl
8592-
implements
8593-
// ignore:deprecated_member_use_from_same_package,analyzer_use_new_elements
8594-
MixinElement,
8595-
MixinFragment {
8552+
implements MixinFragment {
85968553
List<InterfaceTypeImpl> _superclassConstraints = const [];
85978554

85988555
/// Names of methods, getters, setters, and operators that this mixin
@@ -8606,10 +8563,6 @@ class MixinElementImpl extends ClassOrMixinElementImpl
86068563
/// given [offset] in the file that contains the declaration of this element.
86078564
MixinElementImpl(super.name, super.offset);
86088565

8609-
@Deprecated(elementModelDeprecationMsg)
8610-
@override
8611-
AugmentedMixinElement get augmented => AugmentedMixinElementImpl(this);
8612-
86138566
@override
86148567
MixinElementImpl2 get element {
86158568
linkedData?.read(this);
@@ -8663,15 +8616,6 @@ class MixinElementImpl extends ClassOrMixinElementImpl
86638616
void appendTo(ElementDisplayStringBuilder builder) {
86648617
builder.writeMixinElement(this);
86658618
}
8666-
8667-
@Deprecated('Use MixinElement2 instead')
8668-
@override
8669-
bool isImplementableIn(LibraryElement library) {
8670-
if (library == this.library) {
8671-
return true;
8672-
}
8673-
return !isBase;
8674-
}
86758619
}
86768620

86778621
class MixinElementImpl2 extends InterfaceElementImpl2 implements MixinElement2 {

0 commit comments

Comments
 (0)