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

Update the primary constructors proposal #3836

Merged
merged 7 commits into from
Jun 13, 2024
Merged

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented May 24, 2024

This PR makes adjustments to the proposal about primary constructors such that it is in line with the results from discussions at the recent physical language team meeting.

In particular, it removes support for a primary constructor which is declared in the body of the class/enum/etc, and only allows for the form which is part of the header of the class declaration. It also removes the ability to infer the modifier required in a formal parameter declaration.

(Inferred required is now a separate proposal, see https://github.com/dart-lang/language/blob/main/working/0015-infer-required/feature-specification.md.)

It preserves the ability to omit final from every parameter when the primary constructor is constant, because we already have the ability to omit final in the primary constructor of an extension type declaration.

@eernstg eernstg changed the title Update the primary constructors proposal according to recent physical language team meeting Update the primary constructors proposal May 24, 2024
@eernstg eernstg force-pushed the spec_primary_constructors_may24 branch from 0eba2aa to ef2a122 Compare May 24, 2024 16:47
@eernstg eernstg requested a review from lrhn May 24, 2024 16:50
@eernstg eernstg merged commit fdc0b73 into main Jun 13, 2024
3 checks passed
@eernstg eernstg deleted the spec_primary_constructors_may24 branch June 13, 2024 18:01
lrhn pushed a commit that referenced this pull request Jun 28, 2024
Make adjustments to the proposal about primary constructors such that it is in line with the results from discussions at the recent physical language team meeting.

In particular, remove support for a `primary` constructor which is declared in the body of the class/enum/etc, and only allow for the form which is part of the header of the class declaration. Also remove the ability to infer the modifier `required` in a formal parameter declaration.

(Inferred `required` is now a separate proposal, see https://github.com/dart-lang/language/blob/main/working/0015-infer-required/feature-specification.md.)

The ability to omit `final` from every parameter when the primary constructor is constant is preserved because we already have the ability to omit `final` in the primary constructor of an extension type declaration.
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.

2 participants