Skip to content

Commit f677d94

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Document that clients shouldn't create classes based on SyntacticEntity.
We never intended for clients to be able to create their own classes that implement `SyntacticEntity`. Explicitly documenting that they shouldn't do so makes it safer to add members to the class in the future. Change-Id: I6a6a696465b98a1f3363222e9e61889514110ba9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467644 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
1 parent 6ae9152 commit f677d94

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/_fe_analyzer_shared/lib/src/base/syntactic_entity.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import 'package:_fe_analyzer_shared/src/base/analyzer_public_api.dart';
66

77
/// Interface representing a syntactic entity (either a token or an AST node)
88
/// which has a location and extent in the source file.
9+
///
10+
/// Clients may not extend, implement or mix-in this class.
911
@AnalyzerPublicApi(
1012
message: 'exported by package:analyzer/dart/ast/syntactic_entity.dart',
1113
)

pkg/analyzer/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
Use `isOriginDeclaration`, `isOriginInterface`, `isOriginVariable` instead.
3232
* Deprecate `Element.isSynthetic`, use `isOriginXyz` properties instead.
3333
* Deprecate `LibraryElement.isSynthetic`, use `isOriginNotExistingFile` instead.
34+
* Document that the class `SyntacticEntity` is not intended to be subclassed by
35+
clients.
3436

3537
## 9.0.0
3638
* Remove deprecated field `Diagnostic.data`.

0 commit comments

Comments
 (0)