[S] Change in dart/sdk[main]: Add documentation for the deprecated_factory_method warning

0 views
Skip to first unread message

Brian Wilkerson (Gerrit)

unread,
Dec 9, 2025, 4:20:14 PM (12 days ago) Dec 9
to Brian Wilkerson, Connie Ooi, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Connie Ooi
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not 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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Tue, 09 Dec 2025 21:20:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Connie Ooi (Gerrit)

unread,
Dec 17, 2025, 6:33:35 PM (4 days ago) Dec 17
to Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Connie Ooi added 4 comments

File pkg/analyzer/messages.yaml
Line 25341, Patchset 2 (Latest): The analyzer produces this diagnostic when the declaration of an instance
method named `factory` will be interpreted as a constructor declaration
after the `primary_constructors` feature is enabled.
Connie Ooi . unresolved

The analyzer produces this diagnostic when the declaration of an instance method named `factory` is interpreted as a constructor declaration after the `primary_constructors` feature is enabled.

Line 25345, Patchset 2 (Latest): This problem only impacts declarations where there's no return type and
the name of the method is either the first token or is preceded only by
`external`, `augment`, or `augment external`. The last two will only be
valid after the `augmentations` feature is enabled.
Connie Ooi . unresolved

This issue only affects declarations that lack a return type and where the method name is the first token or is preceded only by `external`, `augment`, or `augment external`. The `augment` and `augment external` keywords are valid only after the `augmentations` feature is enabled.

Line 25363, Patchset 2 (Latest): If the name could reasonably be changed, then rename the method:
Connie Ooi . unresolved

Rename the method if the name can be changed:

Line 25371, Patchset 2 (Latest): If the name can't reasonably be changed, then add a return type:
Connie Ooi . unresolved

Add a return type if the name must remain `factory`:

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not 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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 2
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Wed, 17 Dec 2025 23:33:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Dec 18, 2025, 11:00:42 AM (3 days ago) Dec 18
to Brian Wilkerson, Connie Ooi, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi

Brian Wilkerson voted and added 4 comments

Votes added by Brian Wilkerson

Commit-Queue+1

4 comments

File pkg/analyzer/messages.yaml
Line 25341, Patchset 2: The analyzer produces this diagnostic when the declaration of an instance

method named `factory` will be interpreted as a constructor declaration
after the `primary_constructors` feature is enabled.
Connie Ooi . resolved

The analyzer produces this diagnostic when the declaration of an instance method named `factory` is interpreted as a constructor declaration after the `primary_constructors` feature is enabled.

Brian Wilkerson

Done

Line 25345, Patchset 2: This problem only impacts declarations where there's no return type and

the name of the method is either the first token or is preceded only by
`external`, `augment`, or `augment external`. The last two will only be
valid after the `augmentations` feature is enabled.
Connie Ooi . resolved

This issue only affects declarations that lack a return type and where the method name is the first token or is preceded only by `external`, `augment`, or `augment external`. The `augment` and `augment external` keywords are valid only after the `augmentations` feature is enabled.

Brian Wilkerson

Done

Line 25363, Patchset 2: If the name could reasonably be changed, then rename the method:
Connie Ooi . unresolved

Rename the method if the name can be changed:

Brian Wilkerson

This breaks the if-then format used in every other piece of diagnostic documentation, so I didn't apply it. But I did replace "could reasonably" with "can".

Line 25371, Patchset 2: If the name can't reasonably be changed, then add a return type:
Connie Ooi . unresolved

Add a return type if the name must remain `factory`:

Brian Wilkerson

Same here. I updated the wording while retaining the if-then structure.

Open in Gerrit

Related details

Attention is currently required from:
  • Connie Ooi
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not 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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 16:00:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Connie Ooi <conn...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Connie Ooi (Gerrit)

unread,
Dec 18, 2025, 1:39:15 PM (3 days ago) Dec 18
to Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Connie Ooi added 2 comments

File pkg/analyzer/messages.yaml
Line 25363, Patchset 2: If the name could reasonably be changed, then rename the method:
Connie Ooi . resolved

Rename the method if the name can be changed:

Brian Wilkerson

This breaks the if-then format used in every other piece of diagnostic documentation, so I didn't apply it. But I did replace "could reasonably" with "can".

Connie Ooi

Done

Line 25371, Patchset 2: If the name can't reasonably be changed, then add a return type:
Connie Ooi . resolved

Add a return type if the name must remain `factory`:

Brian Wilkerson

Same here. I updated the wording while retaining the if-then structure.

Connie Ooi

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not 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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 18:39:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
Comment-In-Reply-To: Connie Ooi <conn...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Connie Ooi (Gerrit)

unread,
Dec 18, 2025, 1:39:29 PM (3 days ago) Dec 18
to Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Connie Ooi voted

Code-Review+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 18:39:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Dec 19, 2025, 10:10:40 AM (2 days ago) Dec 19
to Brian Wilkerson, Samuel Rawlins, Connie Ooi, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi and Samuel Rawlins

Brian Wilkerson voted and added 1 comment

Votes added by Brian Wilkerson

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Brian Wilkerson . resolved

PTAL

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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 4
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 15:10:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Dec 19, 2025, 11:03:15 AM (2 days ago) Dec 19
to Brian Wilkerson, Connie Ooi, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Connie Ooi

Samuel Rawlins voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Connie Ooi
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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 4
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:03:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Dec 19, 2025, 11:35:16 AM (2 days ago) Dec 19
to Brian Wilkerson, Samuel Rawlins, Connie Ooi, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Connie Ooi

Brian Wilkerson voted and added 1 comment

Votes added by Brian Wilkerson

Commit-Queue+2

1 comment

Patchset-level comments
Brian Wilkerson . resolved

I'm going to land this, but I'm happy to update the docs if there are further changes desired.

Open in Gerrit

Related details

Attention is currently required from:
  • Connie Ooi
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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 4
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Connie Ooi <conn...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Connie Ooi <conn...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:35:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Dec 19, 2025, 11:35:49 AM (2 days ago) Dec 19
to Brian Wilkerson, Samuel Rawlins, Connie Ooi, dart-analys...@google.com, rev...@dartlang.org

Commit Queue submitted the change

Change information

Commit message:
Add documentation for the deprecated_factory_method warning
Change-Id: If215a7b2d2faebe3959831837077c370509e9399
Reviewed-by: Connie Ooi <conn...@google.com>
Reviewed-by: Samuel Rawlins <sraw...@google.com>
Commit-Queue: Brian Wilkerson <brianwi...@google.com>
Files:
  • M pkg/analyzer/messages.yaml
Change size: S
Delta: 1 file changed, 43 insertions(+), 0 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Samuel Rawlins, +1 by Connie Ooi
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: If215a7b2d2faebe3959831837077c370509e9399
Gerrit-Change-Number: 467220
Gerrit-PatchSet: 5
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages