[XL] Change in dart/sdk[main]: [dyn_modules] Support types in a dynamic interface.

1 view
Skip to first unread message

Sigmund Cherem (Gerrit)

unread,
Mar 6, 2026, 8:29:03 PM (4 days ago) Mar 6
to Sigmund Cherem, Alexander Markov, dart-fe-te...@google.com, dart-uxr...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Markov

Sigmund Cherem added 2 comments

File pkg/front_end/lib/src/kernel/dynamic_module_validator.dart
Line 372, Patchset 2 (Latest): static const String canBeUsedAsTypePragmaName =
Sigmund Cherem . resolved

Note: we are not using this yet, so we can wait to add this until we need it. Thoughts: are there any entities in the SDK we currently label as callable that we may want to label as `can-be-used-as-type` instead?

File runtime/vm/object.cc
Line 28036, Patchset 2 (Latest): (pragma_name != Symbols::dyn_module_can_be_used_as_type().ptr())) {
Sigmund Cherem . resolved

I have less familiarity here, so I'm not sure if this is the right change. Without this, end-to-end tests pass in debug-mode but crash in release-mode.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: I900b22b85950f8ac379eabaa2ef58f075e18519c
Gerrit-Change-Number: 486340
Gerrit-PatchSet: 2
Gerrit-Owner: Sigmund Cherem <sig...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Sat, 07 Mar 2026 01:29:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Johnni Winther (Gerrit)

unread,
4:54 AM (6 hours ago) 4:54 AM
to Sigmund Cherem, Alexander Markov, dart-fe-te...@google.com, dart-uxr...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Markov and Sigmund Cherem

Johnni Winther voted and added 1 comment

Votes added by Johnni Winther

Code-Review+1

1 comment

File pkg/front_end/testcases/general/dynamic_modules/main.dart
Line 183, Patchset 2 (Latest):void testCanBeUsedAsType(Object? o) {
Johnni Winther . unresolved

Add tests for types that are inferred. For instance if you allow `B` and `C` but not `A` in

    class A {}
class B extends A {}
class C extends A {}

then the inferred type `A` in this should be flagged:
    var list = [B(), C()];
Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
  • Sigmund Cherem
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: I900b22b85950f8ac379eabaa2ef58f075e18519c
Gerrit-Change-Number: 486340
Gerrit-PatchSet: 2
Gerrit-Owner: Sigmund Cherem <sig...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-Attention: Sigmund Cherem <sig...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Tue, 10 Mar 2026 08:53:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Alexander Markov (Gerrit)

unread,
8:59 AM (2 hours ago) 8:59 AM
to Sigmund Cherem, Johnni Winther, Alexander Markov, dart-fe-te...@google.com, dart-uxr...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Sigmund Cherem

Alexander Markov added 3 comments

File pkg/vm/lib/transformations/type_flow/native_code.dart
Line 131, Patchset 2 (Latest): "'implicitly-extendable', or 'can-be-used-as-type'.\n"
Alexander Markov . unresolved

We don't support these values in the entry-point pragmas, so the updated message is misleading.

Line 147, Patchset 2 (Latest): "'call', or 'can-be-used-as-type'.\n"
Alexander Markov . unresolved

ditto

File runtime/vm/object.cc
Line 28036, Patchset 2 (Latest): (pragma_name != Symbols::dyn_module_can_be_used_as_type().ptr())) {
Sigmund Cherem . unresolved

I have less familiarity here, so I'm not sure if this is the right change. Without this, end-to-end tests pass in debug-mode but crash in release-mode.

Alexander Markov

This makes `dyn-module:can-be-used-as-type` pragma behave pretty much like `dyn-module:callable`, i.e. VM would treat annotated class as instantiated. I think we need a proper implementation in the VM - see uses of this function.

Open in Gerrit

Related details

Attention is currently required from:
  • Sigmund Cherem
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: I900b22b85950f8ac379eabaa2ef58f075e18519c
Gerrit-Change-Number: 486340
Gerrit-PatchSet: 2
Gerrit-Owner: Sigmund Cherem <sig...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-Attention: Sigmund Cherem <sig...@google.com>
Gerrit-Comment-Date: Tue, 10 Mar 2026 12:59:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sigmund Cherem <sig...@google.com>
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages