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

Provide "Inline arrays" article with explanation examples #42349

Conversation

BartoszKlonowski
Copy link
Contributor

@BartoszKlonowski BartoszKlonowski commented Aug 26, 2024

This pull request fixes #42329

It adds the examples presenting the cases of having non-acceptable types of inline struct fields, as well as the reference type used for it.
I didn't include the value type as that most simple scenario was already presented when showing the inline array declaration general example.
This PR also enhances the sentence mentioning the restrictions so that it is more clear and readable that those restrictions are for fields.
Moreover, the "See also" section has been provided with the link to compiler errors (messages) regarding this new feature of inline arrays.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/builtin-types/struct.md docs/csharp/language-reference/builtin-types/struct

@dotnet-bot dotnet-bot added this to the August 2024 milestone Aug 26, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Aug 26, 2024
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Thanks @BartoszKlonowski

This LGTM, and I'll :shipit: as soon as the build finishes.

@BillWagner BillWagner enabled auto-merge (squash) August 27, 2024 14:22
@BillWagner BillWagner merged commit a893a7d into dotnet:main Aug 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc lang-reference/subsvc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline arrays – struct vs struct & reference types
3 participants