[XL] Change in dart/sdk[main]: DeCo. Build extension type primary constructors like regular ones.

0 views
Skip to first unread message

Konstantin Shcheglov (Gerrit)

unread,
Dec 12, 2025, 8:44:16 PM (9 days ago) Dec 12
to Paul Berry, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Johnni Winther and Paul Berry

Konstantin Shcheglov voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Johnni Winther
  • Paul Berry
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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
Gerrit-Change-Number: 465180
Gerrit-PatchSet: 13
Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Paul Berry <paul...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Sat, 13 Dec 2025 01:44:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Johnni Winther (Gerrit)

unread,
Dec 15, 2025, 6:25:59 AM (6 days ago) Dec 15
to Konstantin Shcheglov, Paul Berry, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Konstantin Shcheglov and Paul Berry

Johnni Winther voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Konstantin Shcheglov
  • Paul Berry
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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
    Gerrit-Change-Number: 465180
    Gerrit-PatchSet: 13
    Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Attention: Paul Berry <paul...@google.com>
    Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Comment-Date: Mon, 15 Dec 2025 11:25:56 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Brian Wilkerson (Gerrit)

    unread,
    Dec 15, 2025, 10:58:51 AM (6 days ago) Dec 15
    to Konstantin Shcheglov, Brian Wilkerson, Johnni Winther, Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Konstantin Shcheglov and Paul Berry

    Brian Wilkerson voted and added 2 comments

    Votes added by Brian Wilkerson

    Code-Review+1

    2 comments

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

    LGTM once the code completion change is reverted.

    File pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
    Line 2474, Patchset 13 (Latest): declarationHelper(mustBeType: true).addLexicalDeclarations(node);
    Brian Wilkerson . unresolved

    I believe that this is close to being right, but missing some details. I am working on a CL to support code completion when the primary-constructors feature is enabled, so it would be easiest for me if you reverted this change.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Konstantin Shcheglov
    • Paul Berry
    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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
    Gerrit-Change-Number: 465180
    Gerrit-PatchSet: 13
    Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Reviewer: Paul Berry <paul...@google.com>
    Gerrit-Attention: Paul Berry <paul...@google.com>
    Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Comment-Date: Mon, 15 Dec 2025 15:58:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Konstantin Shcheglov (Gerrit)

    unread,
    Dec 15, 2025, 9:41:59 PM (6 days ago) Dec 15
    to Brian Wilkerson, Johnni Winther, Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson, Johnni Winther and Paul Berry

    Konstantin Shcheglov added 2 comments

    Patchset-level comments
    File-level comment, Patchset 14 (Latest):
    Konstantin Shcheglov . resolved

    PTAL

    File pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart
    Line 2474, Patchset 13: declarationHelper(mustBeType: true).addLexicalDeclarations(node);
    Brian Wilkerson . resolved

    I believe that this is close to being right, but missing some details. I am working on a CL to support code completion when the primary-constructors feature is enabled, so it would be easiest for me if you reverted this change.

    Konstantin Shcheglov

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Brian Wilkerson
    • Johnni Winther
    • Paul Berry
    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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
      Gerrit-Change-Number: 465180
      Gerrit-PatchSet: 14
      Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
      Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Reviewer: Paul Berry <paul...@google.com>
      Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Attention: Paul Berry <paul...@google.com>
      Gerrit-Attention: Johnni Winther <johnni...@google.com>
      Gerrit-Comment-Date: Tue, 16 Dec 2025 02:41:56 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
      unsatisfied_requirement
      open
      diffy

      Brian Wilkerson (Gerrit)

      unread,
      Dec 16, 2025, 10:31:17 AM (5 days ago) Dec 16
      to Konstantin Shcheglov, Brian Wilkerson, Johnni Winther, Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Johnni Winther, Konstantin Shcheglov and Paul Berry

      Brian Wilkerson voted and added 1 comment

      Votes added by Brian Wilkerson

      Code-Review+1

      1 comment

      Patchset-level comments
      Brian Wilkerson . resolved

      The analysis server changes lgtm.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Johnni Winther
      • Konstantin Shcheglov
      • Paul Berry
      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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
        Gerrit-Change-Number: 465180
        Gerrit-PatchSet: 14
        Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Paul Berry <paul...@google.com>
        Gerrit-Attention: Paul Berry <paul...@google.com>
        Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Attention: Johnni Winther <johnni...@google.com>
        Gerrit-Comment-Date: Tue, 16 Dec 2025 15:31:13 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Johnni Winther (Gerrit)

        unread,
        Dec 17, 2025, 3:59:53 AM (5 days ago) Dec 17
        to Konstantin Shcheglov, Brian Wilkerson, Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Konstantin Shcheglov and Paul Berry

        Johnni Winther voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Konstantin Shcheglov
        • Paul Berry
        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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
        Gerrit-Change-Number: 465180
        Gerrit-PatchSet: 14
        Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Paul Berry <paul...@google.com>
        Gerrit-Attention: Paul Berry <paul...@google.com>
        Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Comment-Date: Wed, 17 Dec 2025 08:59:48 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Paul Berry (Gerrit)

        unread,
        Dec 19, 2025, 10:05:31 AM (2 days ago) Dec 19
        to Konstantin Shcheglov, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
        Attention needed from Konstantin Shcheglov

        Paul Berry voted and added 1 comment

        Votes added by Paul Berry

        Code-Review+1

        1 comment

        Patchset-level comments
        Paul Berry . resolved

        Changes to tests/language lgtm

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Konstantin Shcheglov
        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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
        Gerrit-Change-Number: 465180
        Gerrit-PatchSet: 14
        Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Paul Berry <paul...@google.com>
        Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 15:05:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Konstantin Shcheglov (Gerrit)

        unread,
        Dec 19, 2025, 10:06:26 AM (2 days ago) Dec 19
        to Paul Berry, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org

        Konstantin Shcheglov voted Commit-Queue+2

        Commit-Queue+2
        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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
        Gerrit-Change-Number: 465180
        Gerrit-PatchSet: 14
        Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
        Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Paul Berry <paul...@google.com>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 15:06:23 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Commit Queue (Gerrit)

        unread,
        Dec 19, 2025, 10:38:37 AM (2 days ago) Dec 19
        to Konstantin Shcheglov, Paul Berry, Johnni Winther, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org

        Commit Queue submitted the change

        Change information

        Commit message:
        DeCo. Build extension type primary constructors like regular ones.

        Previously, the AST builder enforced strict constraints on extension
        type primary constructors during parsing, often discarding or
        transforming invalid parameters (e.g., multiple, optional, or named
        parameters) to force a valid representation field structure. This
        limited recovery and resulted in inaccurate element models for invalid
        code.

        This change updates the AST builder to parse and build elements for the
        primary constructor's formal parameters exactly as written. The
        validation logic ensuring a single, positional representation field has
        been moved to `ErrorVerifier`.

        To maintain the invariant that an extension type has a representation, a
        synthetic "recovery" representation field is now added to the element
        model if the parsed parameters do not provide a valid one.
        Change-Id: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
        Reviewed-by: Paul Berry <paul...@google.com>
        Reviewed-by: Brian Wilkerson <brianwi...@google.com>
        Reviewed-by: Johnni Winther <johnni...@google.com>
        Commit-Queue: Konstantin Shcheglov <sche...@google.com>
        Files:
        • M pkg/analysis_server/test/services/completion/dart/location/extension_type_declaration_test.dart
        • M pkg/analysis_server/test/src/services/correction/fix/remove_comma_test.dart
        • M pkg/analyzer/api.txt
        • M pkg/analyzer/lib/dart/element/element.dart
        • M pkg/analyzer/lib/src/dart/analysis/driver.dart
        • M pkg/analyzer/lib/src/dart/ast/ast.dart
        • M pkg/analyzer/lib/src/dart/element/element.dart
        • M pkg/analyzer/lib/src/dart/element/element.g.dart
        • M pkg/analyzer/lib/src/dart/element/member.dart
        • M pkg/analyzer/lib/src/fasta/ast_builder.dart
        • M pkg/analyzer/lib/src/fine/manifest_item.dart
        • M pkg/analyzer/lib/src/generated/error_verifier.dart
        • M pkg/analyzer/lib/src/summary2/element_builder.dart
        • M pkg/analyzer/test/src/dart/parser/extension_type_test.dart
        • M pkg/analyzer/test/src/dart/resolution/extension_type_test.dart
        • M pkg/analyzer/test/src/diagnostics/test_all.dart
        • M pkg/analyzer/test/src/summary/element_text.dart
        • M pkg/analyzer/test/src/summary/elements/extension_type_test.dart
        • M tests/language/extension_type/regress_53625_error_test.dart
        Change size: XL
        Delta: 19 files changed, 8442 insertions(+), 1086 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Paul Berry, +1 by Johnni Winther, +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: I37b7eaf2c085db6317b2c2b0bf35ff31423f9738
        Gerrit-Change-Number: 465180
        Gerrit-PatchSet: 15
        Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
        Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages