Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate the ability for macros to add mixins and interfaces #3211

Closed
jakemac53 opened this issue Jul 10, 2023 · 2 comments
Closed

Investigate the ability for macros to add mixins and interfaces #3211

jakemac53 opened this issue Jul 10, 2023 · 2 comments
Assignees
Labels
static-metaprogramming Issues related to static metaprogramming

Comments

@jakemac53
Copy link
Contributor

jakemac53 commented Jul 10, 2023

Augmentation libraries already support this, any with or implements are just appended to the originals (although there is a TODO to figure out if this is for sure the desired behavior).

We do need to consider some of the implications here - such as:

  • Which phase can you do this (almost certainly phase 1 only, since it affects types).
  • Does this have ordering implications/complications? You can't tell reliably for instance if the interface/mixin is already present in phase 1. Multiple macros may try to add the same mixins/interfaces etc, should macros be able to see the ones added by other macros already in the same phase?
    • Maybe we should only allow implements but not with? Ordering and duplication may not matter if we did that.
  • If ordering does matter, are we okay with the potential loss of parallelism in phase 1?
@jakemac53 jakemac53 added the static-metaprogramming Issues related to static metaprogramming label Jul 10, 2023
@jakemac53 jakemac53 self-assigned this Jul 18, 2023
@jakemac53
Copy link
Contributor Author

Review out here for the API https://dart-review.googlesource.com/c/sdk/+/314821.

There also needs to be some specification work to say that ordering matters in phase 1 so I will leave this open until that also gets sent out and lands.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jul 21, 2023
the types phase.

Also seales the Code types hierarchy to block users from attempting to
create their own subclasses.

Bug: dart-lang/language#3211
Change-Id: I51ebdfdad6e1fba3c19ef91f25e238730e98e740
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314821
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
@jakemac53
Copy link
Contributor Author

This has landed

kmorkos added a commit to nielsenko/realm-dart that referenced this issue May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
static-metaprogramming Issues related to static metaprogramming
Projects
Development

No branches or pull requests

1 participant