[S] Change in dart/sdk[main]: [dart:js_interop] Support extension types on generic type parameters

0 views
Skip to first unread message

Arnav Arora (Gerrit)

unread,
2:43 PM (4 hours ago) 2:43 PM
to Srujan Gaddam, Nate Biggs, rev...@dartlang.org
Attention needed from Nate Biggs and Srujan Gaddam

Arnav Arora voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Nate Biggs
  • Srujan Gaddam
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: I80f4a1bdcf9ddf69e84a5410460444ffb44d2993
Gerrit-Change-Number: 532100
Gerrit-PatchSet: 1
Gerrit-Owner: Arnav Arora <ar...@google.com>
Gerrit-Reviewer: Arnav Arora <ar...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Nate Biggs <nate...@google.com>
Gerrit-Attention: Srujan Gaddam <sru...@google.com>
Gerrit-Comment-Date: Wed, 05 Aug 2026 18:43:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Srujan Gaddam (Gerrit)

unread,
3:31 PM (4 hours ago) 3:31 PM
to Arnav Arora, dart-...@luci-project-accounts.iam.gserviceaccount.com, Nate Biggs, rev...@dartlang.org
Attention needed from Arnav Arora and Nate Biggs

Srujan Gaddam voted and added 4 comments

Votes added by Srujan Gaddam

Code-Review+1

4 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Srujan Gaddam . resolved

Change LGTM, just some comments on testing.

File pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart
Line 1165, Patchset 1 (Latest): final interopType = getCoreInteropType(onType.nonTypeParameterBound);
Srujan Gaddam . unresolved

nit: This support the legacy `@staticInterop` types as well. Maybe worth adding a test where the extension is on a type parameter that is bound to a `@staticInterop` type as well?

File tests/lib/js/static_interop_test/external_extension_members_test.dart
Line 101, Patchset 1 (Latest): V extends JSObject
Srujan Gaddam . unresolved

Maybe use a user-defined extension type here to test with as the type parameter bound? Like `ExtensionType` in tests/lib/js/static_interop_test/extension_type/external_extension_member_test.dart?

Line 94, Patchset 1 (Latest):extension SelfReferenceExtension<T extends JSObject> on T {
external T? get selfReference;
}

extension ChainedSelfReferenceExtension<
T extends U,
U extends V,
V extends JSObject
>
on T {
external T? get chainedSelfReference;
}
Srujan Gaddam . unresolved

Consider putting these in tests/lib/js/static_interop_test/extension_type/external_extension_member_test.dart instead and use this test just for a type parameter bound to a `@staticInterop` type test instead.

Open in Gerrit

Related details

Attention is currently required from:
  • Arnav Arora
  • Nate Biggs
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: I80f4a1bdcf9ddf69e84a5410460444ffb44d2993
Gerrit-Change-Number: 532100
Gerrit-PatchSet: 1
Gerrit-Owner: Arnav Arora <ar...@google.com>
Gerrit-Reviewer: Arnav Arora <ar...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Arnav Arora <ar...@google.com>
Gerrit-Attention: Nate Biggs <nate...@google.com>
Gerrit-Comment-Date: Wed, 05 Aug 2026 19:31:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Arnav Arora (Gerrit)

unread,
5:39 PM (1 hour ago) 5:39 PM
to Srujan Gaddam, dart-...@luci-project-accounts.iam.gserviceaccount.com, Nate Biggs, rev...@dartlang.org
Attention needed from Nate Biggs and Srujan Gaddam

Arnav Arora voted and added 3 comments

Votes added by Arnav Arora

Commit-Queue+1

3 comments

File pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart
Line 1165, Patchset 1: final interopType = getCoreInteropType(onType.nonTypeParameterBound);
Srujan Gaddam . resolved

nit: This support the legacy `@staticInterop` types as well. Maybe worth adding a test where the extension is on a type parameter that is bound to a `@staticInterop` type as well?

Arnav Arora

Done

File tests/lib/js/static_interop_test/external_extension_members_test.dart
Line 101, Patchset 1: V extends JSObject
Srujan Gaddam . resolved

Maybe use a user-defined extension type here to test with as the type parameter bound? Like `ExtensionType` in tests/lib/js/static_interop_test/extension_type/external_extension_member_test.dart?

Arnav Arora

Done

Line 94, Patchset 1:extension SelfReferenceExtension<T extends JSObject> on T {

external T? get selfReference;
}

extension ChainedSelfReferenceExtension<
T extends U,
U extends V,
V extends JSObject
>
on T {
external T? get chainedSelfReference;
}
Srujan Gaddam . resolved

Consider putting these in tests/lib/js/static_interop_test/extension_type/external_extension_member_test.dart instead and use this test just for a type parameter bound to a `@staticInterop` type test instead.

Arnav Arora

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Nate Biggs
  • Srujan Gaddam
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: I80f4a1bdcf9ddf69e84a5410460444ffb44d2993
    Gerrit-Change-Number: 532100
    Gerrit-PatchSet: 2
    Gerrit-Owner: Arnav Arora <ar...@google.com>
    Gerrit-Reviewer: Arnav Arora <ar...@google.com>
    Gerrit-Reviewer: Nate Biggs <nate...@google.com>
    Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
    Gerrit-Attention: Nate Biggs <nate...@google.com>
    Gerrit-Attention: Srujan Gaddam <sru...@google.com>
    Gerrit-Comment-Date: Wed, 05 Aug 2026 21:39:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Srujan Gaddam <sru...@google.com>
    unsatisfied_requirement
    open
    diffy

    Srujan Gaddam (Gerrit)

    unread,
    5:43 PM (1 hour ago) 5:43 PM
    to Arnav Arora, dart-...@luci-project-accounts.iam.gserviceaccount.com, Nate Biggs, rev...@dartlang.org
    Attention needed from Arnav Arora and Nate Biggs

    Srujan Gaddam added 3 comments

    File tests/lib/js/static_interop_test/extension_type/external_extension_member_test.dart
    Line 118, Patchset 2 (Latest): {
    Srujan Gaddam . unresolved

    Very tiny nit, but do we need the extra scope? Pro is that it breaks apart the multiple tests better but con is that it's inconsistent with the rest of the test.

    Line 125, Patchset 2 (Latest): extensionObj as JSObject;
    Srujan Gaddam . unresolved

    nit: Don't need the cast because the type implements `JSObject`.

    File tests/lib/js/static_interop_test/external_extension_members_test.dart
    Line 295, Patchset 2 (Latest): var obj = StaticInteropClass();
    Srujan Gaddam . unresolved

    This doesn't exist in the JS `eval` code, so I expect this test will fail.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Arnav Arora
    • Nate Biggs
    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: I80f4a1bdcf9ddf69e84a5410460444ffb44d2993
    Gerrit-Change-Number: 532100
    Gerrit-PatchSet: 2
    Gerrit-Owner: Arnav Arora <ar...@google.com>
    Gerrit-Reviewer: Arnav Arora <ar...@google.com>
    Gerrit-Reviewer: Nate Biggs <nate...@google.com>
    Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
    Gerrit-Attention: Arnav Arora <ar...@google.com>
    Gerrit-Attention: Nate Biggs <nate...@google.com>
    Gerrit-Comment-Date: Wed, 05 Aug 2026 21:43:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Arnav Arora (Gerrit)

    unread,
    6:04 PM (1 hour ago) 6:04 PM
    to Srujan Gaddam, dart-...@luci-project-accounts.iam.gserviceaccount.com, Nate Biggs, rev...@dartlang.org
    Attention needed from Nate Biggs and Srujan Gaddam

    Arnav Arora voted and added 3 comments

    Votes added by Arnav Arora

    Commit-Queue+1

    3 comments

    File tests/lib/js/static_interop_test/extension_type/external_extension_member_test.dart
    Line 118, Patchset 2: {
    Srujan Gaddam . resolved

    Very tiny nit, but do we need the extra scope? Pro is that it breaks apart the multiple tests better but con is that it's inconsistent with the rest of the test.

    Arnav Arora

    Done

    Line 125, Patchset 2: extensionObj as JSObject;
    Srujan Gaddam . resolved

    nit: Don't need the cast because the type implements `JSObject`.

    Arnav Arora

    Done

    File tests/lib/js/static_interop_test/external_extension_members_test.dart
    Line 295, Patchset 2: var obj = StaticInteropClass();
    Srujan Gaddam . resolved

    This doesn't exist in the JS `eval` code, so I expect this test will fail.

    Arnav Arora

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nate Biggs
    • Srujan Gaddam
    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: I80f4a1bdcf9ddf69e84a5410460444ffb44d2993
    Gerrit-Change-Number: 532100
    Gerrit-PatchSet: 3
    Gerrit-Owner: Arnav Arora <ar...@google.com>
    Gerrit-Reviewer: Arnav Arora <ar...@google.com>
    Gerrit-Reviewer: Nate Biggs <nate...@google.com>
    Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
    Gerrit-Attention: Nate Biggs <nate...@google.com>
    Gerrit-Attention: Srujan Gaddam <sru...@google.com>
    Gerrit-Comment-Date: Wed, 05 Aug 2026 22:04:10 +0000
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages