Skip to content

Add feature specification of generic constructors#4265

Merged
eernstg merged 5 commits into
mainfrom
spec_generic_constructor_feb25
Jul 4, 2025
Merged

Add feature specification of generic constructors#4265
eernstg merged 5 commits into
mainfrom
spec_generic_constructor_feb25

Conversation

@eernstg
Copy link
Copy Markdown
Member

@eernstg eernstg commented Feb 13, 2025

Here is a first version of said feature specification, based on the proposal in #4213.

@eernstg eernstg requested review from leafpetersen and lrhn February 13, 2025 14:43
eernstg added a commit that referenced this pull request Mar 5, 2025
…#4212)

Rename 'feature-specification-variant2.md' to 'feature-specification.md', based on the assumption that this proposal is more likely to have broad support than the other proposal.

This PR rewrites the contents of that feature specification such that it relies on generic constructors #4265, which simplifies the proposal significantly. It can be adjusted to work with other proposals about generic constructors.

The mest perspicuous simplification is the following: If multiple accessible extension declarations with on-declaration `C` declare a constructor named `C.name` (or named `C`), and `C` itself doesn't declare such a constructor then an invocation of `C.name(...)` (respectively `C(...)`), as well as variants with actual type arguments, is an error because of the ambiguity. No attempt is made to determine that some extensions are "more specific" than others.
@eernstg eernstg force-pushed the spec_generic_constructor_feb25 branch from 7aae602 to 4cb6a22 Compare March 6, 2025 13:45
@eernstg eernstg force-pushed the spec_generic_constructor_feb25 branch from 4cb6a22 to 427c5b7 Compare April 8, 2025 14:25
@eernstg eernstg force-pushed the spec_generic_constructor_feb25 branch from 427c5b7 to a32697a Compare May 16, 2025 14:17
@eernstg
Copy link
Copy Markdown
Member Author

eernstg commented Jul 4, 2025

I'll land this because it's in the 'working' directory. Discussions about details can be handled in further PRs.

@eernstg eernstg merged commit bca4110 into main Jul 4, 2025
3 checks passed
@eernstg eernstg deleted the spec_generic_constructor_feb25 branch July 4, 2025 08:04
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