Skip to content

Commit c644933

Browse files
committed
Elements. Make ElementDirective abstract, not sealed.
This allows to have `ElementDirectiveImpl` internally. Presubmit in google3 is green: cl/752778004 Change-Id: Ia56ad45fab8d95aa5a089aae338414a7f5c4d549 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425340 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 4f3a672 commit c644933

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

pkg/analyzer/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* Deprecate `AnalysisError.correction` field; use
1010
`AnalysisError.correctionMessage` instead.
1111
* Deprecate `ErrorType`; use `DiagnosticType` instead.
12+
* Change `ElementDirective` from `sealed` to `abstract`.
13+
This allows the analyzer to have an internal implementation
14+
class corresponding to `ElementDirective`.
1215

1316
## 7.4.1
1417
* Restore `InstanceElement.augmented` getter.

pkg/analyzer/api.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3115,7 +3115,8 @@ package:analyzer/dart/element/element.dart:
31153115
isWidgetFactory (getter: bool)
31163116
computeConstantValue (method: DartObject? Function())
31173117
toSource (method: String Function())
3118-
ElementDirective (class extends Object implements Annotatable, sealed (immediate subtypes: LibraryExport, LibraryImport, PartInclude)):
3118+
ElementDirective (class extends Object implements Annotatable):
3119+
new (constructor: ElementDirective Function())
31193120
libraryFragment (getter: LibraryFragment)
31203121
uri (getter: DirectiveUri)
31213122
ElementKind (class extends Object implements Comparable<ElementKind>):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ abstract class ElementAnnotation implements ConstantEvaluationTarget {
845845
/// A directive within a library fragment.
846846
///
847847
/// Clients may not extend, implement or mix-in this class.
848-
sealed class ElementDirective implements Annotatable {
848+
abstract class ElementDirective implements Annotatable {
849849
/// The library fragment that contains this object.
850850
LibraryFragment get libraryFragment;
851851

0 commit comments

Comments
 (0)