Skip to content

Conversation

@srawlins
Copy link
Member

Since the mixin was introduced, and the class modifiers, we've had some tech debt around our mixins. We have a lot of mixins, and some of them are better suited as interfaces or base classes. In this case, Locatable was a mixin with mostly abstract getters, and one implemented getter. To me this really smelled like it should be an interface.

Turns out, that implemented getter, documentationIsLocal, is only called on Warnable objects (which implemented Locatable). So we can move the getter to Warnable.

Then we can change every case of with Locatable to implements Locatable. Except that the interface isn't even needed on some classes, like Category and Package, so we can just remove the mixin there.

Then a rename. I think it's idiomatic for mixin names to end in "able" like "Locatable," "Warnable," "Namable" to suggest the ability that is mixed in. And it is more idiomatic for an interface to start with "Has" to suggest features that are implemented by an implementing class. But there's nothing hard-and-fast here; I'm open to other naming ideas.

@srawlins srawlins merged commit 6d1aa6f into dart-lang:main Oct 23, 2025
13 checks passed
@srawlins srawlins deleted the has-location branch October 23, 2025 15:11
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Oct 27, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/98d03ad..6d1aa6f):
  6d1aa6f5  2025-10-23  Sam Rawlins  Refactor Locatable into an interface, HasLocation (dart-lang/dartdoc#4118)
  f82cd35d  2025-10-23  Sam Rawlins  Remove unused extension method, replaced in analyzer 8.4.0 (dart-lang/dartdoc#4119)

protobuf (https://github.com/dart-lang/protobuf/compare/78cf743..7db0784):
  7db0784  2025-10-24  Ömer Sinan Ağacan  Avoid redundant nullability checks when updating repeated fields (google/protobuf.dart#1069)
  a77f9a6  2025-10-23  Ömer Sinan Ağacan  More field validation tests (google/protobuf.dart#1068)
  27730db  2025-10-21  Ömer Sinan Ağacan  Move PbMap to its own library (google/protobuf.dart#1066)
  9b4c46f  2025-10-21  Ömer Sinan Ağacan  More clearExtension tests: (google/protobuf.dart#1064)
  5a44489  2025-10-21  Ömer Sinan Ağacan  Move PbList to its own library (google/protobuf.dart#1063)

test (https://github.com/dart-lang/test/compare/8083c8f..5855358):
  58553580  2025-10-24  Nate Bosch  Add a sentence to clarify "Platform" (dart-lang/test#2550)

tools (https://github.com/dart-lang/tools/compare/5fe6ee6..e0cc0bc):
  e0cc0bcc  2025-10-27  Morgan :)  Test DirectoryWatcher exception on missing path. (dart-lang/tools#2224)
  e6ce99da  2025-10-24  Morgan :)  Test new link to directory races, fix for them (dart-lang/tools#2223)
  9053fae7  2025-10-24  Morgan :)  Check file sizes as well as "last modified" times. (dart-lang/tools#2221)

Change-Id: Ica6937ba0af21c5ba435e97bd0673fbe7b3043cc
Tested: update test goldens
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457800
Auto-Submit: Devon Carew <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants