Skip to content

Document InlineArray explicit Size breaking change for .NET 10 #47906

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 8, 2025

This PR documents a breaking change introduced in .NET 10 Preview 7 where specifying explicit Size to a struct decorated with InlineArrayAttribute is now disallowed and throws a TypeLoadException.

Changes Made

  • Added: New breaking change document at docs/core/compatibility/core-libraries/10.0/inlinearray-explicit-size-disallowed.md
  • Updated: docs/core/compatibility/10.0.md to include the new breaking change in the Core .NET libraries table
  • Updated: docs/core/compatibility/toc.yml to add navigation entry for the new document

Breaking Change Details

Previous behavior: Specifying explicit Size on structs with InlineArrayAttribute resulted in implementation-specific behavior that might not match user expectations.

New behavior: Starting in .NET 10 Preview 7, such usage now throws a TypeLoadException when creating instances or performing other operations on these types.

Type: Binary incompatible change - existing binaries may fail to load or execute and require recompilation.

Reason: The explicit Size specification for inline array structs is ambiguous and contradicts the specification.

Recommended action: Use wrapper structs when explicit size specification is needed for either array elements or the whole inline array.

The documentation follows established patterns and Microsoft Writing Style Guide principles, providing clear explanations and actionable guidance for developers affected by this change.

Fixes #47435.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] [Breaking change]: Specifying explicit struct Size is not disallowed with InlineArray Document InlineArray explicit Size breaking change for .NET 10 Aug 8, 2025
@Copilot Copilot AI requested a review from gewarren August 8, 2025 22:54
Copilot finished work on behalf of gewarren August 8, 2025 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Breaking change]: Specifying explicit struct Size is not disallowed with InlineArray
2 participants