@@ -524,6 +524,17 @@ abstract class Element2 {
524
524
void visitChildren2 <T >(ElementVisitor2 <T > visitor);
525
525
}
526
526
527
+ /// A directive within a library fragment.
528
+ ///
529
+ /// Clients may not extend, implement or mix-in this class.
530
+ sealed class ElementDirective implements Annotatable {
531
+ /// The library fragment that contains this object.
532
+ LibraryFragment get libraryFragment;
533
+
534
+ /// The interpretation of the URI specified in the directive.
535
+ DirectiveUri get uri;
536
+ }
537
+
527
538
/// An object that can be used to visit an element structure.
528
539
///
529
540
/// Clients may not extend, implement or mix-in this class. There are classes
@@ -1619,7 +1630,7 @@ abstract class LibraryElement2 implements Element2, Annotatable {
1619
1630
/// An `export` directive within a library fragment.
1620
1631
///
1621
1632
/// Clients may not extend, implement or mix-in this class.
1622
- abstract class LibraryExport implements Annotatable {
1633
+ abstract class LibraryExport implements ElementDirective {
1623
1634
/// The combinators that were specified as part of the `export` directive.
1624
1635
///
1625
1636
/// The combinators are in the order in which they were specified.
@@ -1630,9 +1641,6 @@ abstract class LibraryExport implements Annotatable {
1630
1641
1631
1642
/// The offset of the `export` keyword.
1632
1643
int get exportKeywordOffset;
1633
-
1634
- /// The interpretation of the URI specified in the directive.
1635
- DirectiveUri get uri;
1636
1644
}
1637
1645
1638
1646
/// The portion of a [LibraryElement2] coming from a single compilation unit.
@@ -1718,7 +1726,7 @@ abstract class LibraryFragment implements Fragment, Annotatable {
1718
1726
/// An `import` directive within a library fragment.
1719
1727
///
1720
1728
/// Clients may not extend, implement or mix-in this class.
1721
- abstract class LibraryImport implements Annotatable {
1729
+ abstract class LibraryImport implements ElementDirective {
1722
1730
/// The combinators that were specified as part of the `import` directive.
1723
1731
///
1724
1732
/// The combinators are in the order in which they were specified.
@@ -1737,19 +1745,13 @@ abstract class LibraryImport implements Annotatable {
1737
1745
/// an implicit import of `dart:core` .
1738
1746
bool get isSynthetic;
1739
1747
1740
- /// The library fragment that contains this object.
1741
- LibraryFragment ? get libraryFragment;
1742
-
1743
1748
/// The [Namespace] that this directive contributes to the containing library.
1744
1749
Namespace get namespace;
1745
1750
1746
1751
/// The prefix fragment that was specified as part of the import directive.
1747
1752
///
1748
1753
/// Returns `null` if there was no prefix specified.
1749
1754
PrefixFragment ? get prefix2;
1750
-
1751
- /// The interpretation of the URI specified in the directive.
1752
- DirectiveUri get uri;
1753
1755
}
1754
1756
1755
1757
/// An element that can be (but is not required to be) defined within a method
@@ -2090,9 +2092,9 @@ abstract class MultiplyDefinedFragment implements Fragment {
2090
2092
/// A 'part' directive within a library fragment.
2091
2093
///
2092
2094
/// Clients may not extend, implement or mix-in this class.
2093
- abstract class PartInclude {
2094
- /// The interpretation of the URI specified in the directive .
2095
- DirectiveUri get uri ;
2095
+ abstract class PartInclude implements ElementDirective {
2096
+ /// The [LibraryFragment] , if [uri] is a [DirectiveUriWithUnit] .
2097
+ LibraryFragment ? get includedFragment ;
2096
2098
}
2097
2099
2098
2100
/// A pattern variable.
0 commit comments