[M] Change in dart/sdk[main]: analyzer: Tidy up documentation for the new Deprecated annotation war...

0 views
Skip to first unread message

Brian Wilkerson (Gerrit)

unread,
Sep 26, 2025, 11:18:19 AM (3 days ago) Sep 26
to Samuel Rawlins, Brian Wilkerson, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi and Samuel Rawlins

Brian Wilkerson voted and added 4 comments

Votes added by Brian Wilkerson

Code-Review+1

4 comments

File pkg/analyzer/messages.yaml
Line 23957, Patchset 3 (Latest): This annotation indicates that extending the annotated class is deprecated
and will soon be removed. This change will likely be enforced by marking
Brian Wilkerson . unresolved

This doesn't read well IMO. It seems wrong to say that "extending the class will be removed". I liked "ability" (or "capability"); it sounded more correct. How about "the ability to extend the annotated class is deprecated"? (Here and below.)

Line 24261, Patchset 3 (Latest): DEPRECATED_SUBCLASS:
Brian Wilkerson . unresolved

I hadn't thought about it before, but 'subclass' seems wrong. I think we use 'subclass' for 'extends' relationships, so it shouldn't include 'implements'. We use 'subtype' for 'extends', 'implements', and 'with', so it also doesn't really fit this case. I'm not sure why we have a way to only disabling 'extends' and 'implements' relationships, but there isn't a really good name for this.

And maybe it's too late to do anything about it, but I think it's worth fixing if we can.

Line 24274, Patchset 3 (Latest): This annotation indicates that extending or implementing the annotated
Brian Wilkerson . unresolved

I think this emphasizes the terminology problem. Ideally we'd write "the ability to subclass" or "the ability to subtype", but neither of those would imply the correct semantics.

Line 24302, Patchset 3 (Latest): If no instructions are present, then remove the relevant `extends` clause
Brian Wilkerson . unresolved

This is interesting. In the other docs we're saying "Otherwise", implying "if you don't follow the instructions", but this is a fairly different statement "only do this if there are no instructions". I think "Otherwise" is better.

Open in Gerrit

Related details

Attention is currently required from:
  • Connie Ooi
  • Samuel Rawlins
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8eda97f6ffca482f5636b7fbfa3e10e7d58ae8e0
Gerrit-Change-Number: 451223
Gerrit-PatchSet: 3
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 15:18:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Sep 26, 2025, 1:35:42 PM (3 days ago) Sep 26
to Lasse Nielsen, Brian Wilkerson, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Connie Ooi and Lasse Nielsen

Samuel Rawlins added 3 comments

File pkg/analyzer/messages.yaml
Line 23957, Patchset 3 (Latest): This annotation indicates that extending the annotated class is deprecated
and will soon be removed. This change will likely be enforced by marking
Brian Wilkerson . resolved

This doesn't read well IMO. It seems wrong to say that "extending the class will be removed". I liked "ability" (or "capability"); it sounded more correct. How about "the ability to extend the annotated class is deprecated"? (Here and below.)

Samuel Rawlins

I like it. Done.

Brian Wilkerson . unresolved

I hadn't thought about it before, but 'subclass' seems wrong. I think we use 'subclass' for 'extends' relationships, so it shouldn't include 'implements'. We use 'subtype' for 'extends', 'implements', and 'with', so it also doesn't really fit this case. I'm not sure why we have a way to only disabling 'extends' and 'implements' relationships, but there isn't a really good name for this.

And maybe it's too late to do anything about it, but I think it's worth fixing if we can.

Samuel Rawlins

I think we use 'subclass' for 'extends' relationships, so it shouldn't include 'implements'.

That's not how I think of 'subclass'. @l...@google.com proposed this name. I think it's fine, but we have time to change it, if we should.

Line 24302, Patchset 3 (Latest): If no instructions are present, then remove the relevant `extends` clause
Brian Wilkerson . resolved

This is interesting. In the other docs we're saying "Otherwise", implying "if you don't follow the instructions", but this is a fairly different statement "only do this if there are no instructions". I think "Otherwise" is better.

Samuel Rawlins

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Connie Ooi
  • Lasse Nielsen
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8eda97f6ffca482f5636b7fbfa3e10e7d58ae8e0
Gerrit-Change-Number: 451223
Gerrit-PatchSet: 3
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-CC: Lasse Nielsen <l...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Attention: Lasse Nielsen <l...@google.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 17:35:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
satisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Sep 26, 2025, 1:35:50 PM (3 days ago) Sep 26
to Lasse Nielsen, Brian Wilkerson, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Connie Ooi and Lasse Nielsen

Samuel Rawlins voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Connie Ooi
  • Lasse Nielsen
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8eda97f6ffca482f5636b7fbfa3e10e7d58ae8e0
Gerrit-Change-Number: 451223
Gerrit-PatchSet: 4
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Lasse Nielsen <l...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Attention: Lasse Nielsen <l...@google.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 17:35:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Sep 26, 2025, 2:02:28 PM (3 days ago) Sep 26
to Samuel Rawlins, Lasse Nielsen, Brian Wilkerson, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org

Commit Queue submitted the change with unreviewed changes

Unreviewed changes

3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: pkg/analyzer/messages.yaml
Insertions: 8, Deletions: 10.

The diff is too large to show. Please review the diff.
```

Change information

Commit message:
analyzer: Tidy up documentation for the new Deprecated annotation
warnings.
Change-Id: I8eda97f6ffca482f5636b7fbfa3e10e7d58ae8e0
Reviewed-by: Brian Wilkerson <brianwi...@google.com>
Commit-Queue: Samuel Rawlins <sraw...@google.com>
Files:
  • M pkg/analyzer/messages.yaml
Change size: M
Delta: 1 file changed, 43 insertions(+), 45 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Brian Wilkerson
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8eda97f6ffca482f5636b7fbfa3e10e7d58ae8e0
Gerrit-Change-Number: 451223
Gerrit-PatchSet: 5
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
open
diffy
satisfied_requirement

Lasse Nielsen (Gerrit)

unread,
5:22 AM (4 hours ago) 5:22 AM
to Samuel Rawlins, Commit Queue, Brian Wilkerson, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Samuel Rawlins

Lasse Nielsen added 3 comments

File pkg/analyzer/messages.yaml
Line 24261, Patchset 3: DEPRECATED_SUBCLASS:
Brian Wilkerson . unresolved

I hadn't thought about it before, but 'subclass' seems wrong. I think we use 'subclass' for 'extends' relationships, so it shouldn't include 'implements'. We use 'subtype' for 'extends', 'implements', and 'with', so it also doesn't really fit this case. I'm not sure why we have a way to only disabling 'extends' and 'implements' relationships, but there isn't a really good name for this.

And maybe it's too late to do anything about it, but I think it's worth fixing if we can.

Samuel Rawlins

I think we use 'subclass' for 'extends' relationships, so it shouldn't include 'implements'.

That's not how I think of 'subclass'. @l...@google.com proposed this name. I think it's fine, but we have time to change it, if we should.

Lasse Nielsen

If "subclass of A" means something specific, other than just "being a class and being a subtype of A", it probably means extending, directly or transitively, the class `A`. I would use it as the former, but there are people using it as the latter, which is the problem here.

So I don't think "subclass" is used consistently. I try to avoid using it because it might be misunderstood. Sometimes it's used for "extends" relations, sometimes it's just used for being a class *and* a subtype. Sometimes it's used for one level of subclassing, sometimes it's used recursively (and then distinguished by "immediate subclass" or "transitive subclass").

Or when being really pedantic, I use "declared subclass" (the class syntactically referenced by the `extends` clause of a class) for the specific class (whether there are mixin applications between it and this class).

I don't have a better name for this annotation, "subclass" is the word *I* would use, and I don't have a better word for "create a class that directly extends or implements".

Line 24274, Patchset 3: This annotation indicates that extending or implementing the annotated
Brian Wilkerson . unresolved

I think this emphasizes the terminology problem. Ideally we'd write "the ability to subclass" or "the ability to subtype", but neither of those would imply the correct semantics.

Lasse Nielsen

Ack. Or more directly

```
Annotation on a class which will remove the ability to
extend or implement that class, and if the class is
a mixin class, the ability to mix in that class.
The change could be the class becoming `final` or `sealed`.
```

I include mixing in a mixin-class because that is also "subclassing" to me,
so it feels like it should be included if using that name. Most classes are not mixin classes, and it won't affect anything for those. If you do have a mixin class that you want to remove the ability to extend and implement, but not the ability to mix in, then you can still use `.implement` and `.extend`. That probably means it becomes a `mixin` declaration, so you may also remove the ability to instantiate, and one deprecation won't be enough anyway.

("Indicates" is a no-content word. Yoda was right: Do or do not! There is no "indicates".)

Line 24300, Patchset 5 (Latest): annotation. Otherwise, remove the relevant `extends` clause or remove the
Lasse Nielsen . unresolved

"annotation," -> "annotation's deprecation message,",
or just "annotation's message,".

(Maybe, or maybe I'm being too nit-picky. If the reader will understand this, then it's fine.)

Open in Gerrit

Related details

Attention is currently required from:
  • Samuel Rawlins
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8eda97f6ffca482f5636b7fbfa3e10e7d58ae8e0
Gerrit-Change-Number: 451223
Gerrit-PatchSet: 5
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Lasse Nielsen <l...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Mon, 29 Sep 2025 09:22:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages