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

Merge constructor augmentation changes into the augmentations proposal #4164

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

Conversation

jakemac53
Copy link
Contributor

@jakemac53 jakemac53 commented Nov 18, 2024

Merges #4063 into the augmentations feature spec, with modifications from the comments.

  • Changes how non-redirecting generative constructor augmentations work, roughly:
    • Remove special meaning of augmented in these constructor bodies.
    • Remove requirement that initializing formal and super parameters are a part of the "identity" of a constructor call, so future augmentations can change them.
      • Instead, only a single declaration opts a parameter into being either an initializing formal or super parameter.
      • All super parameters must appear in the same declaration, but it need not be the base one.
      • Any declaration introducing super parameters must come before any super constructor invocations.
    • Constructor bodies are invoked in order, starting at the base declaration and then going through the augmentations in first to last order.
  • Describes in detail the non-redirecting generative constructor invocation semantics.

I left off the requirement that the super constructor invocation must appear in the same declaration as any super parameters, and instead allow it to come in any subsequent declaration. It was simply easier to specify, and seemed fairly harmless, but let me know if you think this should change.

cc @lrhn should I bring in the "details of the definitions" section as well or is this sufficient?

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.

1 participant