[M] Change in dart/sdk[main]: CQ. Switch ResolverVisitor to _withUnpromotedThisType().

0 views
Skip to first unread message

Konstantin Shcheglov (Gerrit)

unread,
Jul 15, 2026, 5:01:31 PM (8 hours ago) Jul 15
to Paul Berry, Johnni Winther, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther and Paul Berry

Konstantin Shcheglov voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Johnni Winther
  • Paul Berry
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: Ib4d744bc8e0b8d3056e5029dfb7599543816e0f1
Gerrit-Change-Number: 524642
Gerrit-PatchSet: 1
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-Attention: Paul Berry <paul...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Wed, 15 Jul 2026 21:01:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Paul Berry (Gerrit)

unread,
Jul 15, 2026, 5:46:43 PM (7 hours ago) Jul 15
to Konstantin Shcheglov, Johnni Winther, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther and Konstantin Shcheglov

Paul Berry voted and added 2 comments

Votes added by Paul Berry

Code-Review+1

2 comments

Patchset-level comments
File pkg/analyzer/lib/src/generated/resolver.dart
Line 4834, Patchset 1 (Latest): T _withUnpromotedThisTypeOfEnclosingInstance<T>(T Function() operation) {
Paul Berry . unresolved

Personally I would just inline this method at the call sites. I don't think

```
_withUnpromotedThisTypeOfEnclosingInstance(() { ... });
```

is any easier to read or less error prone than just directly doing:

```
_withUnpromotedThisType(enclosingInstanceElement?.thisType, () { ... });
```

(In fact, I think the latter is a little clearer, since it saves the reader from having to go look up the definition of `_withUnpromotedThisTypeOfEnclosingInstance` in order to figure out what `_unpromotedThisType` is being set to).

Your call though.

Open in Gerrit

Related details

Attention is currently required from:
  • 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: Ib4d744bc8e0b8d3056e5029dfb7599543816e0f1
Gerrit-Change-Number: 524642
Gerrit-PatchSet: 1
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-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Wed, 15 Jul 2026 21:46:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Jul 15, 2026, 5:49:02 PM (7 hours ago) Jul 15
to Paul Berry, Johnni Winther, dart-...@luci-project-accounts.iam.gserviceaccount.com, 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/generated/resolver.dart
Line 4834, Patchset 1 (Latest): T _withUnpromotedThisTypeOfEnclosingInstance<T>(T Function() operation) {
Paul Berry . unresolved

Personally I would just inline this method at the call sites. I don't think

```
_withUnpromotedThisTypeOfEnclosingInstance(() { ... });
```

is any easier to read or less error prone than just directly doing:

```
_withUnpromotedThisType(enclosingInstanceElement?.thisType, () { ... });
```

(In fact, I think the latter is a little clearer, since it saves the reader from having to go look up the definition of `_withUnpromotedThisTypeOfEnclosingInstance` in order to figure out what `_unpromotedThisType` is being set to).

Your call though.

Konstantin Shcheglov

Yeah, I was not sure too.
It probably also goes again the "A Philosophy of Software Design" - too shallow.

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: Ib4d744bc8e0b8d3056e5029dfb7599543816e0f1
Gerrit-Change-Number: 524642
Gerrit-PatchSet: 1
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-Attention: Paul Berry <paul...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Wed, 15 Jul 2026 21:48:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Paul Berry <paul...@google.com>
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Jul 15, 2026, 9:40:48 PM (3 hours ago) Jul 15
to Paul Berry, Johnni Winther, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther and Paul Berry

Konstantin Shcheglov voted and added 1 comment

Votes added by Konstantin Shcheglov

Commit-Queue+2

1 comment

File pkg/analyzer/lib/src/generated/resolver.dart
Line 4834, Patchset 1: T _withUnpromotedThisTypeOfEnclosingInstance<T>(T Function() operation) {
Paul Berry . resolved

Personally I would just inline this method at the call sites. I don't think

```
_withUnpromotedThisTypeOfEnclosingInstance(() { ... });
```

is any easier to read or less error prone than just directly doing:

```
_withUnpromotedThisType(enclosingInstanceElement?.thisType, () { ... });
```

(In fact, I think the latter is a little clearer, since it saves the reader from having to go look up the definition of `_withUnpromotedThisTypeOfEnclosingInstance` in order to figure out what `_unpromotedThisType` is being set to).

Your call though.

Konstantin Shcheglov

Yeah, I was not sure too.
It probably also goes again the "A Philosophy of Software Design" - too shallow.

Konstantin Shcheglov

Done

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: Ib4d744bc8e0b8d3056e5029dfb7599543816e0f1
Gerrit-Change-Number: 524642
Gerrit-PatchSet: 2
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-Attention: Paul Berry <paul...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Thu, 16 Jul 2026 01:40:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Paul Berry <paul...@google.com>
Comment-In-Reply-To: Konstantin Shcheglov <sche...@google.com>
satisfied_requirement
open
diffy

dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
Jul 15, 2026, 10:00:30 PM (3 hours ago) Jul 15
to Konstantin Shcheglov, Paul Berry, Johnni Winther, dart-analys...@google.com, rev...@dartlang.org

dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

Unreviewed changes

1 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/generated/resolver.dart
Insertions: 4, Deletions: 11.

@@ -2476,7 +2476,7 @@
var returnType = element.type.returnType;

_withEnclosingExecutableElement(element, () {
- _withUnpromotedThisTypeOfEnclosingInstance(() {
+ _withUnpromotedThisType(enclosingInstanceElement?.thisType, () {
checkUnreachableNode(node);
node.documentationComment?.accept2(this);
node.metadata.accept2(this);
@@ -2982,7 +2982,7 @@

@override
void visitFieldDeclaration(FieldDeclaration node) {
- _withUnpromotedThisTypeOfEnclosingInstance(() {
+ _withUnpromotedThisType(enclosingInstanceElement?.thisType, () {
checkUnreachableNode(node);
node.visitChildren2(this);
elementResolver.visitFieldDeclaration(node);
@@ -3506,7 +3506,7 @@
var returnType = element.returnType;

_withEnclosingExecutableElement(element, () {
- _withUnpromotedThisTypeOfEnclosingInstance(() {
+ _withUnpromotedThisType(enclosingInstanceElement?.thisType, () {
checkUnreachableNode(node);
node.documentationComment?.accept2(this);
node.metadata.accept2(this);
@@ -3879,7 +3879,7 @@
var returnType = element?.type.returnType;

_withEnclosingExecutableElement(element, () {
- _withUnpromotedThisTypeOfEnclosingInstance(() {
+ _withUnpromotedThisType(enclosingInstanceElement?.thisType, () {
checkUnreachableNode(node);
node.documentationComment?.accept2(this);
node.metadata.accept2(this);
@@ -4831,13 +4831,6 @@
}
}

- T _withUnpromotedThisTypeOfEnclosingInstance<T>(T Function() operation) {
- return _withUnpromotedThisType(
- enclosingInstanceElement?.thisType,
- operation,
- );
- }
-
/// Given an [argumentList] and the [formalParameters] related to the element that
/// will be invoked using those arguments, compute the list of parameters that
/// correspond to the list of arguments.
```

Change information

Commit message:
CQ. Switch ResolverVisitor to _withUnpromotedThisType().
Change-Id: Ib4d744bc8e0b8d3056e5029dfb7599543816e0f1
Reviewed-by: Paul Berry <paul...@google.com>
Commit-Queue: Konstantin Shcheglov <sche...@google.com>
Files:
  • M pkg/analyzer/lib/src/generated/resolver.dart
Change size: M
Delta: 1 file changed, 27 insertions(+), 38 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Paul Berry
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: Ib4d744bc8e0b8d3056e5029dfb7599543816e0f1
Gerrit-Change-Number: 524642
Gerrit-PatchSet: 3
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>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages