[M] Change in dart/sdk[main]: Revert analyzer change to have extension members inherit types.

0 views
Skip to first unread message

Erik Ernst (Gerrit)

unread,
Jan 15, 2026, 10:51:50 AM (7 days ago) Jan 15
to Lasse Nielsen, Konstantin Shcheglov, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Konstantin Shcheglov and Lasse Nielsen

Erik Ernst added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Erik Ernst . resolved

Based on "that's not in the spec", we'd need to remove override inference from `enum` and `mixin` declarations as well. Perhaps the motivation could be "this is not in the spec _and_ it is more controversial than other cases _and_ it hasn't been supported in a stable version".

Open in Gerrit

Related details

Attention is currently required from:
  • Konstantin Shcheglov
  • Lasse Nielsen
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: Iff259d491fbde174e3fabd87c8ec8db8e7960f20
Gerrit-Change-Number: 473280
Gerrit-PatchSet: 2
Gerrit-Owner: Lasse Nielsen <l...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Lasse Nielsen <l...@google.com>
Gerrit-CC: Erik Ernst <eer...@google.com>
Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Attention: Lasse Nielsen <l...@google.com>
Gerrit-Comment-Date: Thu, 15 Jan 2026 15:51:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Lasse Nielsen (Gerrit)

unread,
Jan 15, 2026, 11:16:10 AM (7 days ago) Jan 15
to Konstantin Shcheglov, Erik Ernst, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Erik Ernst and Konstantin Shcheglov

Lasse Nielsen added 1 comment

Patchset-level comments
Erik Ernst . resolved

Based on "that's not in the spec", we'd need to remove override inference from `enum` and `mixin` declarations as well. Perhaps the motivation could be "this is not in the spec _and_ it is more controversial than other cases _and_ it hasn't been supported in a stable version".

Lasse Nielsen

Let me rephrase it as "not in the spec *and* wasn't expected or intended to be part of the extension type feature".

It's not controversial. There is no feature. There is no specification for it, it _doesn't_ generalize cleanly from existing specified features, it wasn't implemented by any tool when extension types were released, and nobody was surprised by that.

Override inference _was_ intended to work for declarations that overrides other declaration signatures. Whether those are declared in a class, mixin or enum declaration, they all use the same override rules. I don't have surviving design documents for override inference, I believe it was part of Dart 2.0, and I'll admit the testing is ... sparse for anything but `class` declarations.
Every implementation has supported override inference since the start, and nobody was surprised by that.

Extension members don't override anything, and there was never any sign that override inference was intended to apply. The [extension type specification](https://github.com/dart-lang/language/blob/main/accepted/3.3/extension-types/feature-specification.md) doesn't mention it. All uses of the word "override" is either in scare-quotes or used as part of a phrase like "no override relation". There is no occurrence of the word "inference".

But the most signficant signal is that it was never implemented, and nobody thought that it should be.

Open in Gerrit

Related details

Attention is currently required from:
  • Erik Ernst
  • 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: Iff259d491fbde174e3fabd87c8ec8db8e7960f20
Gerrit-Change-Number: 473280
Gerrit-PatchSet: 2
Gerrit-Owner: Lasse Nielsen <l...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Lasse Nielsen <l...@google.com>
Gerrit-CC: Erik Ernst <eer...@google.com>
Gerrit-Attention: Erik Ernst <eer...@google.com>
Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Comment-Date: Thu, 15 Jan 2026 16:16:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Erik Ernst <eer...@google.com>
unsatisfied_requirement
open
diffy

Leaf Petersen (Gerrit)

unread,
Jan 21, 2026, 2:23:31 PM (10 hours ago) Jan 21
to Lasse Nielsen, Konstantin Shcheglov, Erik Ernst, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Erik Ernst, Konstantin Shcheglov and Lasse Nielsen

Leaf Petersen added 1 comment

File tests/language/extension_type/no_inheritance_inference_test.dart
Line 22, Patchset 6 (Latest):extension type E(A _) {
Leaf Petersen . unresolved

We should validate that override inference is not performed for the representation variable as well.

Open in Gerrit

Related details

Attention is currently required from:
  • Erik Ernst
  • Konstantin Shcheglov
  • Lasse Nielsen
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: Iff259d491fbde174e3fabd87c8ec8db8e7960f20
Gerrit-Change-Number: 473280
Gerrit-PatchSet: 6
Gerrit-Owner: Lasse Nielsen <l...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Lasse Nielsen <l...@google.com>
Gerrit-CC: Erik Ernst <eer...@google.com>
Gerrit-CC: Leaf Petersen <le...@google.com>
Gerrit-Attention: Erik Ernst <eer...@google.com>
Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Attention: Lasse Nielsen <l...@google.com>
Gerrit-Comment-Date: Wed, 21 Jan 2026 19:23:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Jan 21, 2026, 2:32:08 PM (10 hours ago) Jan 21
to Lasse Nielsen, Leaf Petersen, Erik Ernst, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Erik Ernst and Lasse Nielsen

Konstantin Shcheglov voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Erik Ernst
  • Lasse Nielsen
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: Iff259d491fbde174e3fabd87c8ec8db8e7960f20
Gerrit-Change-Number: 473280
Gerrit-PatchSet: 6
Gerrit-Owner: Lasse Nielsen <l...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Lasse Nielsen <l...@google.com>
Gerrit-CC: Erik Ernst <eer...@google.com>
Gerrit-CC: Leaf Petersen <le...@google.com>
Gerrit-Attention: Erik Ernst <eer...@google.com>
Gerrit-Attention: Lasse Nielsen <l...@google.com>
Gerrit-Comment-Date: Wed, 21 Jan 2026 19:32:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages