[XL] Change in dart/sdk[main]: DeCo. Use origin flags for constructors.

0 views
Skip to first unread message

Johnni Winther (Gerrit)

unread,
Dec 1, 2025, 4:54:05 AM (yesterday) Dec 1
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 and added 2 comments

Votes added by Johnni Winther

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Johnni Winther . resolved

LGTM provided that the change related to Object? are moved to a separate CL.

File pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart
Line 596, Patchset 9 (Latest): return typeProvider.objectQuestionType;
Johnni Winther . unresolved

This change seems unrelated. Should it (and the correlated changes) be moved to its own CL?

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: I8568bdfe478867af313a4d13afe1f2859394831b
Gerrit-Change-Number: 465201
Gerrit-PatchSet: 9
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, 01 Dec 2025 09:53:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Dec 1, 2025, 10:29:24 AM (yesterday) Dec 1
to Johnni Winther, Paul Berry, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson, Johnni Winther and Paul Berry

Konstantin Shcheglov added 1 comment

File pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart
Line 596, Patchset 9: return typeProvider.objectQuestionType;
Johnni Winther . resolved

This change seems unrelated. Should it (and the correlated changes) be moved to its own CL?

Konstantin Shcheglov

I accidentally rebased this CL, but forgot to rebase its parent.
This file change is from master.

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: I8568bdfe478867af313a4d13afe1f2859394831b
    Gerrit-Change-Number: 465201
    Gerrit-PatchSet: 10
    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: Mon, 01 Dec 2025 15:29:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Johnni Winther <johnni...@google.com>
    unsatisfied_requirement
    open
    diffy

    Paul Berry (Gerrit)

    unread,
    Dec 1, 2025, 5:59:39 PM (22 hours ago) Dec 1
    to Konstantin Shcheglov, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson, Johnni Winther and Konstantin Shcheglov

    Paul Berry added 1 comment

    File pkg/analyzer/lib/dart/element/element.dart
    Line 276, Patchset 12 (Latest): bool get isSynthetic;
    Paul Berry . unresolved

    I'm uncomfortable about introducing a deprecated getter that overrides a non-deprecated one, because this means that:

    (a) Clients that call `isSynthetic` through the base class won't see the deprecation message, and
    (b) There is nothing we can remove in a future breaking change release of the analyzer that corresponds to this deprecation.

    Would it be possible, instead, to replace *all* instances of `isSynthetic` with more explicit flags, so that the deprecation can be applied to the base class? (And thus the `isSynthetic` flag can be removed entirely in a future breaking change release of the analyzer)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Brian Wilkerson
    • Johnni Winther
    • Konstantin Shcheglov
    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: I8568bdfe478867af313a4d13afe1f2859394831b
    Gerrit-Change-Number: 465201
    Gerrit-PatchSet: 12
    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: Konstantin Shcheglov <sche...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Mon, 01 Dec 2025 22:59:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Konstantin Shcheglov (Gerrit)

    unread,
    Dec 1, 2025, 6:02:18 PM (22 hours ago) Dec 1
    to Johnni Winther, Paul Berry, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson, Johnni Winther and Paul Berry

    Konstantin Shcheglov added 1 comment

    File pkg/analyzer/lib/dart/element/element.dart
    Line 276, Patchset 12 (Latest): bool get isSynthetic;
    Paul Berry . unresolved

    I'm uncomfortable about introducing a deprecated getter that overrides a non-deprecated one, because this means that:

    (a) Clients that call `isSynthetic` through the base class won't see the deprecation message, and
    (b) There is nothing we can remove in a future breaking change release of the analyzer that corresponds to this deprecation.

    Would it be possible, instead, to replace *all* instances of `isSynthetic` with more explicit flags, so that the deprecation can be applied to the base class? (And thus the `isSynthetic` flag can be removed entirely in a future breaking change release of the analyzer)

    Konstantin Shcheglov

    Yes, eventually `Element.isSynthetic` will be deprecated and removed.
    This CL introduces new flags and migrates what is possible.
    This partial migration serves as reducing amount of work, and to display what and how is migrated.

    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: I8568bdfe478867af313a4d13afe1f2859394831b
    Gerrit-Change-Number: 465201
    Gerrit-PatchSet: 12
    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: Mon, 01 Dec 2025 23:02:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Paul Berry <paul...@google.com>
    unsatisfied_requirement
    open
    diffy

    Paul Berry (Gerrit)

    unread,
    Dec 1, 2025, 6:04:53 PM (22 hours ago) Dec 1
    to Konstantin Shcheglov, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Brian Wilkerson, Johnni Winther and Konstantin Shcheglov

    Paul Berry voted and added 1 comment

    Votes added by Paul Berry

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Paul Berry . resolved

    lgtm assuming the commit message is updated to indicate that the plan is to eventually deprecate and remove `Element.isSynthetic`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Brian Wilkerson
    • Johnni Winther
    • 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: I8568bdfe478867af313a4d13afe1f2859394831b
      Gerrit-Change-Number: 465201
      Gerrit-PatchSet: 12
      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: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Attention: Johnni Winther <johnni...@google.com>
      Gerrit-Comment-Date: Mon, 01 Dec 2025 23:04:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Samuel Rawlins (Gerrit)

      unread,
      12:15 PM (3 hours ago) 12:15 PM
      to Konstantin Shcheglov, Paul Berry, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Brian Wilkerson, Johnni Winther and Konstantin Shcheglov

      Samuel Rawlins voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Brian Wilkerson
      • Johnni Winther
      • 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: I8568bdfe478867af313a4d13afe1f2859394831b
      Gerrit-Change-Number: 465201
      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-Reviewer: Samuel Rawlins <sraw...@google.com>
      Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Attention: Johnni Winther <johnni...@google.com>
      Gerrit-Comment-Date: Tue, 02 Dec 2025 17:15:55 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Phil Quitslund (Gerrit)

      unread,
      12:16 PM (3 hours ago) 12:16 PM
      to Konstantin Shcheglov, Samuel Rawlins, Paul Berry, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Brian Wilkerson, Johnni Winther and Konstantin Shcheglov

      Phil Quitslund voted Code-Review+1

      Gerrit-Reviewer: Phil Quitslund <pquit...@google.com>
      Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
      Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
      Gerrit-Attention: Johnni Winther <johnni...@google.com>
      Gerrit-Comment-Date: Tue, 02 Dec 2025 17:16:17 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Konstantin Shcheglov (Gerrit)

      unread,
      12:19 PM (3 hours ago) 12:19 PM
      to Phil Quitslund, Samuel Rawlins, Paul Berry, Johnni Winther, Brian Wilkerson, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
      Attention needed from Brian Wilkerson and Johnni Winther

      Konstantin Shcheglov voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Brian Wilkerson
      • Johnni Winther
      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: I8568bdfe478867af313a4d13afe1f2859394831b
      Gerrit-Change-Number: 465201
      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-Reviewer: Phil Quitslund <pquit...@google.com>
      Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
      Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
      Gerrit-Attention: Johnni Winther <johnni...@google.com>
      Gerrit-Comment-Date: Tue, 02 Dec 2025 17:19:56 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Commit Queue (Gerrit)

      unread,
      12:20 PM (3 hours ago) 12:20 PM
      to Konstantin Shcheglov, Phil Quitslund, Samuel Rawlins, Paul Berry, Johnni Winther, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org

      Commit Queue submitted the change

      Change information

      Commit message:
      DeCo. Use origin flags for constructors.

      Introduce explicit origin flags on ConstructorElement and its fragment
      (isOriginDeclaration, isOriginImplicitDefault, isOriginMixinApplication)
      and deprecate isSynthetic in favor of these. Define isSynthetic as the
      inverse of isOriginDeclaration to preserve the legacy meaning while
      encouraging clients to use the more precise origin predicates.

      Eventually `Element.isSynthetic` also will be deprecated and removed.
      This CL is a step toward this goal, migrating what is possible with new
      flags.

      Update analyzer internals to rely on the new origin flags when checking
      for non-factory generative constructors, building synthetic constructors
      for mixin applications, and walking constructor chains in index/search
      logic. Only constructors with an origin declaration are now treated as
      declarations, and nonSynthetic is defined in terms of origin
      declarations rather than synthetic-ness. Add corresponding origin
      descriptors to the manifest enum and bump AnalysisDriver.DATA_VERSION.

      Adjust analysis server refactorings and fixes to distinguish implicit
      default constructors from other synthetic constructors. Code paths that
      previously checked isSynthetic for default constructors now check
      isOriginImplicitDefault, and mixin-application traversal uses
      isOriginMixinApplication.

      Overall, this change removes the overloaded semantics of isSynthetic,
      makes constructor provenance explicit, and prepares the element model
      for future DeCo and primary-constructor scenarios without relying on
      brittle synthetic heuristics.
      Change-Id: I8568bdfe478867af313a4d13afe1f2859394831b
      Reviewed-by: Paul Berry <paul...@google.com>
      Reviewed-by: Phil Quitslund <pquit...@google.com>
      Commit-Queue: Konstantin Shcheglov <sche...@google.com>
      Reviewed-by: Samuel Rawlins <sraw...@google.com>
      Files:
      • M pkg/analysis_server/lib/src/cider/rename.dart
      • M pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart
      • M pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart
      • M pkg/analyzer/CHANGELOG.md
      • 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/analysis/index.dart
      • M pkg/analyzer/lib/src/dart/analysis/search.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/dart/micro/utils.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/constructor_initializer_resolver.dart
      • M pkg/analyzer/lib/src/summary2/element_builder.dart
      • M pkg/analyzer/lib/src/summary2/library_builder.dart
      • M pkg/analyzer/lib/src/test_utilities/test_library_builder.dart
      • M pkg/analyzer/test/src/dart/analysis/driver_test.dart
      • M pkg/analyzer/test/src/dart/analysis/results/get_element_declaration_test.dart
      • M pkg/analyzer/test/src/summary/element_text.dart
      • M pkg/analyzer/test/src/summary/elements/class_test.dart
      • M pkg/analyzer/test/src/summary/elements/const_test.dart
      • M pkg/analyzer/test/src/summary/elements/default_value_test.dart
      • M pkg/analyzer/test/src/summary/elements/duplicate_declaration_test.dart
      • M pkg/analyzer/test/src/summary/elements/enum_test.dart
      • M pkg/analyzer/test/src/summary/elements/extension_test.dart
      • M pkg/analyzer/test/src/summary/elements/extension_type_test.dart
      • M pkg/analyzer/test/src/summary/elements/formal_parameter_test.dart
      • M pkg/analyzer/test/src/summary/elements/function_type_annotation_test.dart
      • M pkg/analyzer/test/src/summary/elements/library_export_test.dart
      • M pkg/analyzer/test/src/summary/elements/library_import_test.dart
      • M pkg/analyzer/test/src/summary/elements/local_declarations_test.dart
      • M pkg/analyzer/test/src/summary/elements/metadata_test.dart
      • M pkg/analyzer/test/src/summary/elements/mixin_test.dart
      • M pkg/analyzer/test/src/summary/elements/non_synthetic_test.dart
      • M pkg/analyzer/test/src/summary/elements/offsets_test.dart
      • M pkg/analyzer/test/src/summary/elements/part_include_test.dart
      • M pkg/analyzer/test/src/summary/elements/record_type_test.dart
      • M pkg/analyzer/test/src/summary/elements/since_sdk_version_test.dart
      • M pkg/analyzer/test/src/summary/elements/top_level_function_test.dart
      • M pkg/analyzer/test/src/summary/elements/top_level_variable_test.dart
      • M pkg/analyzer/test/src/summary/elements/type_alias_test.dart
      • M pkg/analyzer/test/src/summary/elements/type_inference_test.dart
      • M pkg/analyzer/test/src/summary/elements/types_test.dart
      • M pkg/analyzer/test/src/summary/top_level_inference_test.dart
      • M pkg/analyzer_plugin/lib/src/utilities/navigation/navigation_dart.dart
      • M pkg/linter/lib/src/rules/use_key_in_widget_constructors.dart
      Change size: XL
      Delta: 49 files changed, 3395 insertions(+), 3214 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Phil Quitslund, +1 by Paul Berry, +1 by Samuel Rawlins
      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: I8568bdfe478867af313a4d13afe1f2859394831b
      Gerrit-Change-Number: 465201
      Gerrit-PatchSet: 14
      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