[L] Change in dart/sdk[main]: Add documentation for several additional warnings

0 views
Skip to first unread message

Brian Wilkerson (Gerrit)

unread,
Aug 7, 2025, 6:48:07 PM8/7/25
to Brian Wilkerson, Samuel Rawlins, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Samuel Rawlins

Brian Wilkerson voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Samuel Rawlins
Submit Requirements:
  • requirement is not 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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
Gerrit-Change-Number: 444390
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Thu, 07 Aug 2025 22:48:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Aug 7, 2025, 6:50:50 PM8/7/25
to Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Samuel Rawlins voted and added 2 comments

Votes added by Samuel Rawlins

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Samuel Rawlins . resolved

Excellent, thanks!

File pkg/analyzer/messages.yaml
Line 27154, Patchset 1 (Latest): The following code produces this diagnostic because :
Samuel Rawlins . unresolved

Remove 'because'? Or keep going?

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
    • requirement is not 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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
    Gerrit-Change-Number: 444390
    Gerrit-PatchSet: 1
    Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
    Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Comment-Date: Thu, 07 Aug 2025 22:50:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Brian Wilkerson (Gerrit)

    unread,
    Aug 11, 2025, 4:48:34 PM8/11/25
    to Brian Wilkerson, Amanda Fitch, Konstantin Shcheglov, Samuel Rawlins, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Amanda Fitch, Konstantin Shcheglov and Samuel Rawlins

    Brian Wilkerson added 1 comment

    File pkg/analyzer/messages.yaml
    Line 27154, Patchset 1: The following code produces this diagnostic because :
    Samuel Rawlins . unresolved

    Remove 'because'? Or keep going?

    Brian Wilkerson

    Sorry, I thought I'd verified the completeness of all of the changes, but I obviously missed one. Now fixed. PTAL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Amanda Fitch
    • Konstantin Shcheglov
    • Samuel Rawlins
    Submit Requirements:
      • requirement is not 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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
      Gerrit-Change-Number: 444390
      Gerrit-PatchSet: 3
      Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
      Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
      Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
      Gerrit-Attention: Amanda Fitch <afi...@google.com>
      Gerrit-Comment-Date: Mon, 11 Aug 2025 20:48:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
      unsatisfied_requirement
      open
      diffy

      Samuel Rawlins (Gerrit)

      unread,
      Aug 11, 2025, 4:49:20 PM8/11/25
      to Brian Wilkerson, Amanda Fitch, Konstantin Shcheglov, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Amanda Fitch, Brian Wilkerson and Konstantin Shcheglov

      Samuel Rawlins voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Amanda Fitch
      • Brian Wilkerson
      • Konstantin Shcheglov
      Submit Requirements:
        • requirement is not 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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 3
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Attention: Amanda Fitch <afi...@google.com>
        Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Comment-Date: Mon, 11 Aug 2025 20:49:17 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Konstantin Shcheglov (Gerrit)

        unread,
        Aug 16, 2025, 1:23:51 PM8/16/25
        to Brian Wilkerson, Samuel Rawlins, Amanda Fitch, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Amanda Fitch and Brian Wilkerson

        Konstantin Shcheglov voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Amanda Fitch
        • 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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 4
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-Attention: Amanda Fitch <afi...@google.com>
        Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Comment-Date: Sat, 16 Aug 2025 17:23:48 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Brian Wilkerson (Gerrit)

        unread,
        Aug 16, 2025, 6:37:40 PM8/16/25
        to Brian Wilkerson, Konstantin Shcheglov, Samuel Rawlins, Amanda Fitch, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Amanda Fitch

        Brian Wilkerson voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Amanda Fitch
        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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 4
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-Attention: Amanda Fitch <afi...@google.com>
        Gerrit-Comment-Date: Sat, 16 Aug 2025 22:37:37 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Commit Queue (Gerrit)

        unread,
        Aug 16, 2025, 7:01:20 PM8/16/25
        to Brian Wilkerson, Konstantin Shcheglov, Samuel Rawlins, Amanda Fitch, dart-analys...@google.com, rev...@dartlang.org

        Commit Queue submitted the change

        Change information

        Commit message:
        Add documentation for several additional warnings
        Change-Id: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Reviewed-by: Samuel Rawlins <sraw...@google.com>
        Reviewed-by: Konstantin Shcheglov <sche...@google.com>
        Commit-Queue: Brian Wilkerson <brianwi...@google.com>
        Files:
        • M pkg/analyzer/lib/src/error/codes.g.dart
        • M pkg/analyzer/messages.yaml
        • M pkg/analyzer/test/verify_diagnostics_test.dart
        Change size: L
        Delta: 3 files changed, 293 insertions(+), 4 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Samuel Rawlins, +1 by Konstantin Shcheglov
        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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 5
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        open
        diffy
        satisfied_requirement

        Connie Ooi (Gerrit)

        unread,
        Sep 8, 2025, 8:08:05 PM9/8/25
        to Commit Queue, Brian Wilkerson, Konstantin Shcheglov, Samuel Rawlins, Amanda Fitch, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Brian Wilkerson

        Connie Ooi added 25 comments

        File pkg/analyzer/lib/src/error/codes.g.dart
        Line 6750, Patchset 5 (Latest): /// String p0: the name of the function or method whose return type couldn't
        /// be inferred
        Connie Ooi . unresolved

        suggestion: "...can't be inferred"

        File pkg/analyzer/messages.yaml
        Line 24669, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . unresolved

        replace 'when' with when:

        Line 24670, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . unresolved

        replace with "the language option `strict-inference` is enabled in the analysis options file,

        Line 24671, Patchset 5 (Latest): - a list, map or set literal doesn't have type arguments, and
        Connie Ooi . unresolved

        replace with "a list, map, or set literal has no type arguments"

        Line 24685, Patchset 5 (Latest): The following code produces this diagnostic because the type of the
        elements of the list literal can't be inferred by the analyzer:
        Connie Ooi . unresolved

        Replace with "The analyzer produces this diagnostic for the following code because it cannot determine the list literal's element type:"

        Line 24717, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . unresolved

        when:

        Line 24718, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . unresolved

        replace with "the language option `strict-inference` is enabled in the analysis options file,"

        Line 24719, Patchset 5 (Latest): - the invocation of a method or function doesn't have type arguments, and
        Connie Ooi . unresolved

        replace with "...has no type arguments, and"

        Line 24733, Patchset 5 (Latest): The following code produces this diagnostic because the invocation of the
        method `m` doesn't have type arguments and the type arguments can't be
        inferred:
        Connie Ooi . unresolved

        rewrite "The analyzer reports this diagnostic because the invocation of method `m` has no type arguments, and the values can't be inferred:"

        Line 24775, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . unresolved

        when:

        Line 24776, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . unresolved

        see above suggestions for this phrase

        Line 24777, Patchset 5 (Latest): - the declaration of a method or function doesn't have a return type, and
        Connie Ooi . unresolved

        see above "... has no return type"

        Line 24840, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . unresolved

        when:

        Line 24841, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . unresolved

        see above for suggestion

        Line 24842, Patchset 5 (Latest): - the declaration of a variable doesn't have a type, and
        Connie Ooi . unresolved

        replace with "...has no type..."

        Line 24856, Patchset 5 (Latest): The following code produces this diagnostic because the variable `s`
        doesn't have an explicit type and the type can't be inferred because
        there's no initializer:
        Connie Ooi . unresolved

        replace with "The analyzer produces this diagnostic for the following code because the variable `s` has no explicit type and no initializer, so its type cannot be inferred:"

        Line 24883, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . unresolved

        when:

        Line 24884, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . unresolved

        see above

        Line 24885, Patchset 5 (Latest): - the declaration of a formal parameter doesn't have a type, and
        Connie Ooi . unresolved

        "...has no type"

        Line 24888, Patchset 5 (Latest): The type of a parameter of a method can be inferred if the method
        overrides an inherited method.
        Connie Ooi . unresolved

        rewrite "The type of a method's parameter can be inferred if it overrides an inherited method."

        Line 27018, Patchset 5 (Latest): The analyzer produces this diagnostic when the type of the object being
        matched can't ever be matched by the pattern.
        Connie Ooi . unresolved

        rewrite: "The analyzer produces this diagnostic when the object's type can't be matched by the pattern."

        Line 27023, Patchset 5 (Latest): The following code produces this diagnostic because a `double` is being
        matched by a pattern that requires an `int`, which can never succeed:
        Connie Ooi . unresolved

        replace with "This diagnostic is produced because a `double` is matched by an `int` pattern, which can never succeed."

        Line 27034, Patchset 5 (Latest): If one of the types is wrong, then change one or both of the types so that
        the pattern can succeed:
        Connie Ooi . unresolved

        replace with "If one of the types is wrong, change one or both so the pattern match can succeed."

        Line 27043, Patchset 5 (Latest): If the types aren't wrong, then remove the pattern match:
        Connie Ooi . unresolved

        "If the types are correct..."

        Line 27140, Patchset 5 (Latest): The analyzer produces this diagnostic when a lint that has been removed is
        used in an analysis options file. Because the lint has been removed, the
        reference to it (such as enabling it) will have no effect.
        Connie Ooi . unresolved

        suggestion: "The analyzer produces this diagnostic when a lint that has been removed is used in an analysis options file. Because the lint no longer exists, referencing it will have no effect."

        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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 5
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-CC: Connie Ooi <conn...@google.com>
        Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Comment-Date: Tue, 09 Sep 2025 00:08:02 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Brian Wilkerson (Gerrit)

        unread,
        Sep 14, 2025, 2:53:57 PM9/14/25
        to Brian Wilkerson, Commit Queue, Connie Ooi, Konstantin Shcheglov, Samuel Rawlins, Amanda Fitch, dart-analys...@google.com, rev...@dartlang.org

        Brian Wilkerson added 27 comments

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

        Thanks for the review!

        I have questions about a couple of the changes, but most of them I've already applied in a follow-up CL. I'll send out the new CL after we've finished discussing my questions.

        File pkg/analyzer/lib/src/error/codes.g.dart
        Line 6750, Patchset 5 (Latest): /// String p0: the name of the function or method whose return type couldn't
        /// be inferred
        Connie Ooi . resolved

        suggestion: "...can't be inferred"

        Brian Wilkerson

        Done

        File pkg/analyzer/messages.yaml
        Line 24669, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . resolved

        replace 'when' with when:

        Brian Wilkerson

        Done

        Line 24670, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . resolved

        replace with "the language option `strict-inference` is enabled in the analysis options file,

        Brian Wilkerson

        Done

        Line 24671, Patchset 5 (Latest): - a list, map or set literal doesn't have type arguments, and
        Connie Ooi . resolved

        replace with "a list, map, or set literal has no type arguments"

        Brian Wilkerson

        Done

        Line 24685, Patchset 5 (Latest): The following code produces this diagnostic because the type of the
        elements of the list literal can't be inferred by the analyzer:
        Connie Ooi . unresolved

        Replace with "The analyzer produces this diagnostic for the following code because it cannot determine the list literal's element type:"

        Brian Wilkerson

        You're right that in one sense it's really the analyzer producing the diagnostic and not the code itself, and in many ways what you wrote is more readable.

        However, the docs are extremely formulaic. This was done intentionally for easy of reading by humans, and I think it probably helps LLMs as well. As a result I'm hesitant to deviate from the formula.

        I'm wondering whether we can improve the text without sacrificing the formula. For example:
        ```


        The following code produces this diagnostic because the type of the

        list literal's elements can't be inferred:
        ```
        What do you think?

        Line 24717, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . resolved

        when:

        Brian Wilkerson

        Done

        FWIW, while I have no problem with how you reviewed these docs, I'm fine with a suggestion including something like "here and elsewhere" as a reminder to go through the changes looking for similar text that needs to be updated in the same way. Might save you some time when reviewing future docs.

        Line 24718, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . resolved

        replace with "the language option `strict-inference` is enabled in the analysis options file,"

        Brian Wilkerson

        Done

        Line 24719, Patchset 5 (Latest): - the invocation of a method or function doesn't have type arguments, and
        Connie Ooi . resolved

        replace with "...has no type arguments, and"

        Brian Wilkerson

        Done

        Line 24733, Patchset 5 (Latest): The following code produces this diagnostic because the invocation of the
        method `m` doesn't have type arguments and the type arguments can't be
        inferred:
        Connie Ooi . unresolved

        rewrite "The analyzer reports this diagnostic because the invocation of method `m` has no type arguments, and the values can't be inferred:"

        Brian Wilkerson

        Similar to above, what do you think of
        ```
        The following code produces this diagnostic because the invocation of `m`
        has no explicit type arguments, and the arguments can't be inferred:
        ```
        I think it might be better to say "arguments" rather than "values" because it might not be clear which values we're talking about, especially for developers whose primary language isn't English. (I also add "explicit", because it's more technically correct, something I missed originally.)

        Line 24775, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . resolved

        when:

        Brian Wilkerson

        Done

        Line 24776, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . resolved

        see above suggestions for this phrase

        Brian Wilkerson

        Done

        Line 24777, Patchset 5 (Latest): - the declaration of a method or function doesn't have a return type, and
        Connie Ooi . resolved

        see above "... has no return type"

        Brian Wilkerson

        Done

        Line 24840, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . resolved

        when:

        Brian Wilkerson

        Done

        Line 24841, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . resolved

        see above for suggestion

        Brian Wilkerson

        Done

        Line 24842, Patchset 5 (Latest): - the declaration of a variable doesn't have a type, and
        Connie Ooi . resolved

        replace with "...has no type..."

        Brian Wilkerson

        Done

        Line 24856, Patchset 5 (Latest): The following code produces this diagnostic because the variable `s`
        doesn't have an explicit type and the type can't be inferred because
        there's no initializer:
        Connie Ooi . unresolved

        replace with "The analyzer produces this diagnostic for the following code because the variable `s` has no explicit type and no initializer, so its type cannot be inferred:"

        Brian Wilkerson

        I think the original is better because if the variable had an explicit type then there would be no inference. In other words, the precondition for this diagnostic is that there is a variable without an explicit type annotation, and the error is that inference can't be applied because there is no initializer. The suggested text kind of sounds to me like the problem is the absence of both a type and an initializer, and I'm wondering whether some developers might interpret it to mean that they need to add both (which isn't the case).

        Am I missing something that you're seeing?

        Line 24883, Patchset 5 (Latest): The analyzer produces this diagnostic when
        Connie Ooi . resolved

        when:

        Brian Wilkerson

        Done

        Line 24884, Patchset 5 (Latest): - the language option `strict-inference` has been enabled in the analysis options file,
        Connie Ooi . resolved

        see above

        Brian Wilkerson

        Done

        Line 24885, Patchset 5 (Latest): - the declaration of a formal parameter doesn't have a type, and
        Connie Ooi . resolved

        "...has no type"

        Brian Wilkerson

        Done

        Line 24888, Patchset 5 (Latest): The type of a parameter of a method can be inferred if the method
        overrides an inherited method.
        Connie Ooi . resolved

        rewrite "The type of a method's parameter can be inferred if it overrides an inherited method."

        Brian Wilkerson

        Done

        Line 27018, Patchset 5 (Latest): The analyzer produces this diagnostic when the type of the object being
        matched can't ever be matched by the pattern.
        Connie Ooi . resolved

        rewrite: "The analyzer produces this diagnostic when the object's type can't be matched by the pattern."

        Brian Wilkerson

        Done

        Line 27023, Patchset 5 (Latest): The following code produces this diagnostic because a `double` is being
        matched by a pattern that requires an `int`, which can never succeed:
        Connie Ooi . unresolved

        replace with "This diagnostic is produced because a `double` is matched by an `int` pattern, which can never succeed."

        Brian Wilkerson

        What do you think of
        ```
        The following code produces this diagnostic because a `double` is matched by an `int` pattern, which can never succeed:
        ```

        Line 27034, Patchset 5 (Latest): If one of the types is wrong, then change one or both of the types so that
        the pattern can succeed:
        Connie Ooi . resolved

        replace with "If one of the types is wrong, change one or both so the pattern match can succeed."

        Brian Wilkerson

        Done

        Line 27043, Patchset 5 (Latest): If the types aren't wrong, then remove the pattern match:
        Connie Ooi . resolved

        "If the types are correct..."

        Brian Wilkerson

        Done

        Line 27140, Patchset 5 (Latest): The analyzer produces this diagnostic when a lint that has been removed is
        used in an analysis options file. Because the lint has been removed, the
        reference to it (such as enabling it) will have no effect.
        Connie Ooi . resolved

        suggestion: "The analyzer produces this diagnostic when a lint that has been removed is used in an analysis options file. Because the lint no longer exists, referencing it will have no effect."

        Brian Wilkerson

        Done

        Line 27154, Patchset 1: The following code produces this diagnostic because :
        Samuel Rawlins . resolved

        Remove 'because'? Or keep going?

        Brian Wilkerson

        Sorry, I thought I'd verified the completeness of all of the changes, but I obviously missed one. Now fixed. PTAL.

        Brian Wilkerson

        Done

        Open in Gerrit

        Related details

        Attention set is empty
        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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 5
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-CC: Connie Ooi <conn...@google.com>
        Gerrit-Comment-Date: Sun, 14 Sep 2025 18:53:54 +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>
        Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
        satisfied_requirement
        open
        diffy

        Connie Ooi (Gerrit)

        unread,
        Sep 15, 2025, 6:06:52 PM9/15/25
        to Commit Queue, Brian Wilkerson, Konstantin Shcheglov, Samuel Rawlins, Amanda Fitch, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Brian Wilkerson

        Connie Ooi added 4 comments

        File pkg/analyzer/messages.yaml
        Line 24685, Patchset 5 (Latest): The following code produces this diagnostic because the type of the
        elements of the list literal can't be inferred by the analyzer:
        Connie Ooi . unresolved

        Replace with "The analyzer produces this diagnostic for the following code because it cannot determine the list literal's element type:"

        Brian Wilkerson

        You're right that in one sense it's really the analyzer producing the diagnostic and not the code itself, and in many ways what you wrote is more readable.

        However, the docs are extremely formulaic. This was done intentionally for easy of reading by humans, and I think it probably helps LLMs as well. As a result I'm hesitant to deviate from the formula.

        I'm wondering whether we can improve the text without sacrificing the formula. For example:
        ```
        The following code produces this diagnostic because the type of the
        list literal's elements can't be inferred:
        ```
        What do you think?

        Connie Ooi

        Yeah, that sounds great!

        Line 24733, Patchset 5 (Latest): The following code produces this diagnostic because the invocation of the
        method `m` doesn't have type arguments and the type arguments can't be
        inferred:
        Connie Ooi . unresolved

        rewrite "The analyzer reports this diagnostic because the invocation of method `m` has no type arguments, and the values can't be inferred:"

        Brian Wilkerson

        Similar to above, what do you think of
        ```
        The following code produces this diagnostic because the invocation of `m`
        has no explicit type arguments, and the arguments can't be inferred:
        ```
        I think it might be better to say "arguments" rather than "values" because it might not be clear which values we're talking about, especially for developers whose primary language isn't English. (I also add "explicit", because it's more technically correct, something I missed originally.)

        Connie Ooi

        LGTM

        Line 24856, Patchset 5 (Latest): The following code produces this diagnostic because the variable `s`
        doesn't have an explicit type and the type can't be inferred because
        there's no initializer:
        Connie Ooi . unresolved

        replace with "The analyzer produces this diagnostic for the following code because the variable `s` has no explicit type and no initializer, so its type cannot be inferred:"

        Brian Wilkerson

        I think the original is better because if the variable had an explicit type then there would be no inference. In other words, the precondition for this diagnostic is that there is a variable without an explicit type annotation, and the error is that inference can't be applied because there is no initializer. The suggested text kind of sounds to me like the problem is the absence of both a type and an initializer, and I'm wondering whether some developers might interpret it to mean that they need to add both (which isn't the case).

        Am I missing something that you're seeing?

        Connie Ooi

        That makes sense! I agree to keep the original

        Line 27023, Patchset 5 (Latest): The following code produces this diagnostic because a `double` is being
        matched by a pattern that requires an `int`, which can never succeed:
        Connie Ooi . unresolved

        replace with "This diagnostic is produced because a `double` is matched by an `int` pattern, which can never succeed."

        Brian Wilkerson

        What do you think of
        ```
        The following code produces this diagnostic because a `double` is matched by an `int` pattern, which can never succeed:
        ```

        Connie Ooi

        LGTM

        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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 5
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-CC: Connie Ooi <conn...@google.com>
        Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Comment-Date: Mon, 15 Sep 2025 22:06:49 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Connie Ooi <conn...@google.com>
        Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
        satisfied_requirement
        open
        diffy

        Brian Wilkerson (Gerrit)

        unread,
        Sep 16, 2025, 10:31:05 AM9/16/25
        to Commit Queue, Brian Wilkerson, Connie Ooi, Konstantin Shcheglov, Samuel Rawlins, Amanda Fitch, dart-analys...@google.com, rev...@dartlang.org

        Brian Wilkerson added 5 comments

        Patchset-level comments
        Brian Wilkerson . resolved
        File pkg/analyzer/messages.yaml
        Line 24685, Patchset 5 (Latest): The following code produces this diagnostic because the type of the
        elements of the list literal can't be inferred by the analyzer:
        Connie Ooi . resolved

        Replace with "The analyzer produces this diagnostic for the following code because it cannot determine the list literal's element type:"

        Brian Wilkerson

        You're right that in one sense it's really the analyzer producing the diagnostic and not the code itself, and in many ways what you wrote is more readable.

        However, the docs are extremely formulaic. This was done intentionally for easy of reading by humans, and I think it probably helps LLMs as well. As a result I'm hesitant to deviate from the formula.

        I'm wondering whether we can improve the text without sacrificing the formula. For example:
        ```
        The following code produces this diagnostic because the type of the
        list literal's elements can't be inferred:
        ```
        What do you think?

        Connie Ooi

        Yeah, that sounds great!

        Brian Wilkerson

        Done

        Line 24733, Patchset 5 (Latest): The following code produces this diagnostic because the invocation of the
        method `m` doesn't have type arguments and the type arguments can't be
        inferred:
        Connie Ooi . resolved

        rewrite "The analyzer reports this diagnostic because the invocation of method `m` has no type arguments, and the values can't be inferred:"

        Brian Wilkerson

        Similar to above, what do you think of
        ```
        The following code produces this diagnostic because the invocation of `m`
        has no explicit type arguments, and the arguments can't be inferred:
        ```
        I think it might be better to say "arguments" rather than "values" because it might not be clear which values we're talking about, especially for developers whose primary language isn't English. (I also add "explicit", because it's more technically correct, something I missed originally.)

        Connie Ooi

        LGTM

        Brian Wilkerson

        Done

        Line 24856, Patchset 5 (Latest): The following code produces this diagnostic because the variable `s`
        doesn't have an explicit type and the type can't be inferred because
        there's no initializer:
        Connie Ooi . resolved

        replace with "The analyzer produces this diagnostic for the following code because the variable `s` has no explicit type and no initializer, so its type cannot be inferred:"

        Brian Wilkerson

        I think the original is better because if the variable had an explicit type then there would be no inference. In other words, the precondition for this diagnostic is that there is a variable without an explicit type annotation, and the error is that inference can't be applied because there is no initializer. The suggested text kind of sounds to me like the problem is the absence of both a type and an initializer, and I'm wondering whether some developers might interpret it to mean that they need to add both (which isn't the case).

        Am I missing something that you're seeing?

        Connie Ooi

        That makes sense! I agree to keep the original

        Brian Wilkerson

        Done

        Line 27023, Patchset 5 (Latest): The following code produces this diagnostic because a `double` is being
        matched by a pattern that requires an `int`, which can never succeed:
        Connie Ooi . resolved

        replace with "This diagnostic is produced because a `double` is matched by an `int` pattern, which can never succeed."

        Brian Wilkerson

        What do you think of
        ```
        The following code produces this diagnostic because a `double` is matched by an `int` pattern, which can never succeed:
        ```

        Connie Ooi

        LGTM

        Brian Wilkerson

        Done

        Open in Gerrit

        Related details

        Attention set is empty
        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: If92e477d77c4bd3390ff1b2927ebaea1a76cfa73
        Gerrit-Change-Number: 444390
        Gerrit-PatchSet: 5
        Gerrit-Owner: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Amanda Fitch <afi...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
        Gerrit-CC: Connie Ooi <conn...@google.com>
        Gerrit-Comment-Date: Tue, 16 Sep 2025 14:31:01 +0000
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages