Skip to content

Simplify augmentations. #4357

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Simplify augmentations. #4357

wants to merge 2 commits into from

Conversation

munificent
Copy link
Member

  • Remove references to macros.
  • Don't allow augmentations to wrap or replace code. Remove support for augmented expressions. Disallow an augmentation from providing a body to a declaration that already has one.
  • Remove support for augmenting variables.
  • Simplify constructor augmentations: no concatenating initializers or merging initializers from one augmentation and a body from another.
  • Remove support for augmenting typedefs.
  • Remove support for augmenting redirecting constructors.
  • Allow a function augmentation to have an external body.

There are still more changes I'd like to make. In particular, the grammar for members seems pretty hairy and I suspect could be refactored to be simpler, but I'm not sure if that will cause problems for other people who rely on the existing grammar rules.

- Remove references to macros.
- Don't allow augmentations to wrap or replace code. Remove support for `augmented` expressions. Disallow an augmentation from providing a body to a declaration that already has one.
- Remove support for augmenting variables.
- Simplify constructor augmentations: no concatenating initializers or merging initializers from one augmentation and a body from another.
- Remove support for augmenting typedefs.
- Remove support for augmenting redirecting constructors.
- Allow a function augmentation to have an `external` body.

There are still more changes I'd like to make. In particular, the grammar for members seems pretty hairy and I suspect could be refactored to be simpler, but I'm not sure if that will cause problems for other people who rely on the existing grammar rules.
@munificent munificent requested review from lrhn and eernstg May 6, 2025 03:17
Copy link
Member

@lrhn lrhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More shorter, more better!
I have a gazillion nitpicks and some questions (which might suggest that something could be said to answer that question, or which might suggest that I only read the changed parts and therefore lacked some context.).
And some comments that are better left for later.

Good clean-up!

@munificent
Copy link
Member Author

cc @johnniwinther @scheglov in case you have thoughts on how this would affect the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants