Skip to content

Conversation

@eernstg
Copy link
Member

@eernstg eernstg commented Nov 7, 2024

This PR introduces an error for the case where a redirection (this(...)) is augmented by another redirection, and similarly for a redirecting factory.

This follows the treatment of super-initializers, for which it is also an error to include one in an augmenting declaration if the augmented declaration already has an explicitly declared super-initializer.

Other than that, it clarifies the terminology of the augmentation feature specification slightly, such that we keep this(...) and this.x = 42 clearly separated.

'redirecting initializer' is changed to 'redirection' when talking about generative redirecting constructors. The term is derived from <redirection>, and the word redirection is used in other specification documents about this kind of term. This also helps avoiding the confusion about this(...) possibly being an initializer list element (like x = 42 or assert(b)).

I also added a few words of commentary right after the phrase 'factory redirection' because this phrase is new (the grammar rule actually doesn't have a separate name for the token sequence covered by this phrase). Finally, I deleted a TODO comment which is obsolete today (there are no special grammar rules about augmented).

@eernstg eernstg requested a review from munificent November 7, 2024 13:00
@eernstg eernstg changed the title Adjust the terminology slightly about augmented redirecting constructors Add an error and adjust the terminology slightly about augmented redirecting constructors Nov 7, 2024
Copy link
Member Author

@eernstg eernstg left a comment

Choose a reason for hiding this comment

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

Commented on two changes.

Copy link
Member

@munificent munificent left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying these weird corners!

@eernstg eernstg merged commit 945b6e4 into main Nov 14, 2024
3 checks passed
@eernstg eernstg deleted the adjust_augment_constructors_nov24 branch November 14, 2024 15:15
@eernstg
Copy link
Member Author

eernstg commented Nov 14, 2024

Thanks!

@eernstg
Copy link
Member Author

eernstg commented Nov 14, 2024

@sgrekhov, this should unblock a couple of PRs.

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.

4 participants