Skip to content

Conversation

@eernstg
Copy link
Member

@eernstg eernstg commented Nov 12, 2024

This PR updates the primary constructor feature specification based on recent ideas in an email thread. In particular, it introduces support for an initializer list in a primary constructor in the header of the enclosing declaration (of a class or an enum), and allows parameters to be declared without introducing an instance variable iff they are used for another purpose (such as this.v = x or super.name(x)).

I haven't reintroduced the in-body primary constructors (but we can easily do that, if requested).

As we've done on some earlier occasions, I'll land this document now (it is 'working'). The language team can then discuss it and adjust it as needed in further PRs.

@eernstg eernstg merged commit a530cd6 into main Nov 12, 2024
3 checks passed
@eernstg eernstg deleted the spec_primary_constructors_nov24 branch November 12, 2024 16:34
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