[L] Change in dart/sdk[main]: DeCo. Support for PrimaryConstructorBodyImpl.

0 views
Skip to first unread message

Konstantin Shcheglov (Gerrit)

unread,
Dec 29, 2025, 1:47:04 AM (2 days ago) Dec 29
to Commit Queue, dart-analys...@google.com, rev...@dartlang.org

Konstantin Shcheglov added 1 comment

File tests/language/primary_constructors/type_inference/optional_parameter_test.dart
Line 27, Patchset 4 (Parent): this : o = x.expectStatictype<Exactly<int>>;
Konstantin Shcheglov . unresolved

Method invocations are not allowed in constant constructors.

Open in Gerrit

Related details

Attention set is empty
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: Ifc7b408cfddb1d83e325ab654fa25f072459e3c5
Gerrit-Change-Number: 469960
Gerrit-PatchSet: 4
Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Comment-Date: Mon, 29 Dec 2025 06:47:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
Dec 30, 2025, 10:17:48 AM (20 hours ago) Dec 30
to Konstantin Shcheglov, Paul Berry, Johnni Winther, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther, Konstantin Shcheglov and Paul Berry

Samuel Rawlins voted and added 1 comment

Votes added by Samuel Rawlins

Code-Review+1

1 comment

File pkg/analyzer/lib/src/summary2/ast_resolver.dart
Line 125, Patchset 9 (Latest): void visit(AstVisitor<Object?> visitor) {
Samuel Rawlins . unresolved

I think the correct term here is "accept." "Accept this visitor and accept that visitor."

Open in Gerrit

Related details

Attention is currently required from:
  • Johnni Winther
  • Konstantin Shcheglov
  • Paul Berry
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: Ifc7b408cfddb1d83e325ab654fa25f072459e3c5
Gerrit-Change-Number: 469960
Gerrit-PatchSet: 9
Gerrit-Owner: Konstantin Shcheglov <sche...@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: Paul Berry <paul...@google.com>
Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Tue, 30 Dec 2025 15:17:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Dec 30, 2025, 12:22:50 PM (18 hours ago) Dec 30
to Samuel Rawlins, Paul Berry, Johnni Winther, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther and Paul Berry

Konstantin Shcheglov added 1 comment

File pkg/analyzer/lib/src/summary2/ast_resolver.dart
Line 125, Patchset 9: void visit(AstVisitor<Object?> visitor) {
Samuel Rawlins . resolved

I think the correct term here is "accept." "Accept this visitor and accept that visitor."

Konstantin Shcheglov

You are right! Fixed.

Open in Gerrit

Related details

Attention is currently required from:
  • Johnni Winther
  • Paul Berry
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: Ifc7b408cfddb1d83e325ab654fa25f072459e3c5
Gerrit-Change-Number: 469960
Gerrit-PatchSet: 10
Gerrit-Owner: Konstantin Shcheglov <sche...@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: Paul Berry <paul...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Tue, 30 Dec 2025 17:22:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Samuel Rawlins <sraw...@google.com>
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Dec 30, 2025, 12:22:53 PM (18 hours ago) Dec 30
to Samuel Rawlins, Paul Berry, Johnni Winther, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther and Paul Berry

Konstantin Shcheglov voted Commit-Queue+2

Commit-Queue+2
Gerrit-Comment-Date: Tue, 30 Dec 2025 17:22:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Dec 30, 2025, 12:28:50 PM (18 hours ago) Dec 30
to Samuel Rawlins, Paul Berry, Johnni Winther, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Gerrit-Comment-Date: Tue, 30 Dec 2025 17:28:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Dec 30, 2025, 3:14:28 PM (15 hours ago) Dec 30
to Samuel Rawlins, Paul Berry, Johnni Winther, Commit Queue, dart-analys...@google.com, rev...@dartlang.org

Konstantin Shcheglov submitted the change with unreviewed changes

Unreviewed changes

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

```
The name of the file: pkg/analyzer/lib/src/summary2/ast_resolver.dart
Insertions: 10, Deletions: 10.

@@ -86,17 +86,17 @@
// We don't want to visit the whole node because that will try to create an
// element for it; we just want to process its children so that we can
// resolve initializers and/or a redirection.
- void visit(AstVisitor<Object?> visitor) {
+ void accept(AstVisitor<Object?> visitor) {
node.initializers.accept(visitor);
node.redirectedConstructor?.accept(visitor);
}

_prepareEnclosingDeclarations();
- visit(_resolutionVisitor);
- visit(_scopeResolverVisitor);
+ accept(_resolutionVisitor);
+ accept(_scopeResolverVisitor);

- _flowAnalysis.bodyOrInitializer_enter(node, node.parameters, visit: visit);
- visit(_resolverVisitor);
+ _flowAnalysis.bodyOrInitializer_enter(node, node.parameters, visit: accept);
+ accept(_resolverVisitor);
_resolverVisitor.checkIdle();
_flowAnalysis.bodyOrInitializer_exit();
}
@@ -122,20 +122,20 @@
PrimaryConstructorDeclarationImpl node,
PrimaryConstructorBodyImpl? body,
) {
- void visit(AstVisitor<Object?> visitor) {
+ void accept(AstVisitor<Object?> visitor) {
body?.initializers.accept(visitor);
}

_prepareEnclosingDeclarations();
- visit(_resolutionVisitor);
- visit(_scopeResolverVisitor);
+ accept(_resolutionVisitor);
+ accept(_scopeResolverVisitor);

_flowAnalysis.bodyOrInitializer_enter(
node,
node.formalParameters,
- visit: visit,
+ visit: accept,
);
- visit(_resolverVisitor);
+ accept(_resolverVisitor);
_resolverVisitor.checkIdle();
_flowAnalysis.bodyOrInitializer_exit();
}
```

Change information

Commit message:
DeCo. Support for PrimaryConstructorBodyImpl.

- Add `PrimaryParameterScope`.
- Add `thisKeywordOffset`.
- Store body metadata and initializers into `ConstructorElement`.
- Resolve.
Change-Id: Ifc7b408cfddb1d83e325ab654fa25f072459e3c5
Reviewed-by: Samuel Rawlins <sraw...@google.com>
Files:
  • 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/scope.dart
  • M pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart
  • M pkg/analyzer/lib/src/generated/resolver.dart
  • M pkg/analyzer/lib/src/summary2/ast_resolver.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/informative_data.dart
  • M pkg/analyzer/lib/src/summary2/metadata_resolver.dart
  • M pkg/analyzer/lib/src/summary2/reference_resolver.dart
  • M pkg/analyzer/test/src/dart/parser/class_test.dart
  • M pkg/analyzer/test/src/dart/resolution/class_test.dart
  • M pkg/analyzer/test/src/dart/resolution/enum_test.dart
  • M pkg/analyzer/test/src/dart/resolution/extension_type_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/enum_test.dart
  • M pkg/analyzer/test/src/summary/elements/extension_type_test.dart
Change size: XL
Delta: 22 files changed, 2935 insertions(+), 40 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +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: Ifc7b408cfddb1d83e325ab654fa25f072459e3c5
Gerrit-Change-Number: 469960
Gerrit-PatchSet: 11
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages