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

Use @param to add doc-comment to enumerator fields #684

Open
bernardnormier opened this issue Dec 11, 2023 · 3 comments
Open

Use @param to add doc-comment to enumerator fields #684

bernardnormier opened this issue Dec 11, 2023 · 3 comments
Assignees
Labels
Milestone

Comments

@bernardnormier
Copy link
Member

We should use @param to add doc-comments to the fields of an enumerator.

@InsertCreativityHere
Copy link
Member

On a high-scale level it feels like we're trying to make enums with fields into enums with parameters.
We use the parameter parenthesis (...) instead of field braces {...}, the @param tag instead of direct comment placement.

Should we just embrace this and rename our construct to "enum with parameters"?

In Rust there is truly no difference between fields, whether they're in a struct or in a variant (ie. enumerator),
which I find to be very nice and clean, compared to ours.

@bernardnormier
Copy link
Member Author

We should keep the name "enum with fields". They are fields. This is very similar to records in C#, where you can specify your properties with a primary constructor:

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record

When you declare a primary constructor on a record, the compiler generates public properties for the primary constructor parameters.

@InsertCreativityHere
Copy link
Member

This was partially implemented by 4838a71

But we still need to add validation and tests for it.

@InsertCreativityHere InsertCreativityHere added this to the Future milestone Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants