Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Change RecordType to stop implementing SharedRecordTypeStr…
…ucture. When I introduced the `SharedRecordType` class in https://dart-review.googlesource.com/c/sdk/+/362481 (now called `SharedRecordTypeStructure`), I failed to realize that a side effect of this change was to expose the shared getter `positionalTypes` through the analyzer's public API. Later, when the getter `sortedNamedTypes` was added to this class, that also was inadvertently exposed through the analyzer's public API. To correct that mistake, I've moved the reference to `SharedRecordTypeStructure` from the `implements` clause of `RecordType` to the `implements` clause of `RecordTypeImpl`. To avoid this change causing a breakage for clients, I've also added deprecated declarations of the getters `positionalTypes` and `sortedNamedTypes` to the `RecordType` class. This ensures that if any analyzer clients have already started depending on them, their code will continue to work, but they'll be alerted to the fact that the members will be removed in the future. In the process, I improved the types of `positionalTypes` and `sortedNamedTypes` so that they no longer refer to shared types; this should reduce further API exposure. This is part of a larger arc of work to change the analyzer's use of the shared code so that the type parameters it supplies are not part of the analyzer public API. See #59763. Change-Id: If56b8689180d2214eccd7ec8ec4f4f10b31358f6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402620 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- Loading branch information