Commit Graph

3 Commits

Author SHA1 Message Date
Alexander Markov 9ee6b090a4 [dyn_modules] Allow dynamic modules to use and override public members of _Enum
Private class _Enum is an implementation detail of Dart enums, so
we should not require users to explicitly expose it through dynamic
interface in order to use enums in the dynamic modules.

This change adds pragmas to make all public members of _Enum callable
and allows _Enum.toString() to be overridden in dynamic modules.

TEST=pkg/dynamic_modules/test/data/enum

CoreLibraryReviewExempt: no API changes, only pragmas.
Bug: b/448593948
Change-Id: I37040d4912d6da38fbf568c11ae0834a110d3a46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452880
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2025-10-01 11:36:12 -07:00
Mayank Patke c66f91be23 [dynamic_modules] Update pubspec to 3.8 and reformat.
Change-Id: I7cdfb0000996a711bdee9b1618c20a21bbdda814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427620
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
2025-05-08 14:52:34 -07:00
Alexander Markov 6156dd6e59 [dynamic modules] Respect dyn-module:language-impl:* pragmas during dynamic module validation
Dynamic module validation now accepts reference to classes and members
from 'dart:*' libraries if they are annotated with
dyn-module:language-impl:* pragmas. This matches the behavior of
dynamic interface annotator.

This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/418663.

Also, when checking for possible dynamic overrides in TFA,
treat _enumToString from dart:core as a public name because
front-end desugars enums into classes which override
private _enumToString method in a different library.

TEST=pkg/dynamic_modules/test/data/enum
Fixes b/395992622

Change-Id: I45ed9855f806224a510fa4e56962607de3371eb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423820
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-04-23 07:43:02 -07:00