Skip to content

Preserve ILTrim layout fields - #134083

Draft
jtschuster wants to merge 1 commit into
dev/jtschuster-copilot/ILTrim/interop-parameter-typesfrom
dev/jtschuster-copilot/ILTrim/layout-field-retention
Draft

jtschuster wants to merge 1 commit into
dev/jtschuster-copilot/ILTrim/interop-parameter-typesfrom
dev/jtschuster-copilot/ILTrim/layout-field-retention

Conversation

@jtschuster

@jtschuster jtschuster commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

The draft PRs in this stack I haven't reviewed myself and don't expect anyone else to until I mark them ready for review (unless you want to). If the tags are causing too much noise for anyone I can move them to my fork until their ready.

Layer 5 of 12 in the ILTrim expected-failure reduction stack.

Preserve fields for sequential and explicit-layout types across construction and reflection-visible paths, including inherited layout fields.

Stack-top validation

  • Release ILTrim: 928 total, 424 passed, 504 skipped, 0 failed, 0 errors.
  • ./build.sh tools+tools.ilasm+tools.illinktests+tools.cdactests -test passed with 0 warnings and 0 errors.
  • ILCompiler.Compiler Release build passed with 0 warnings and 0 errors.

Stack created with GitHub Stacks CLI • Give Feedback 💬

Note

This PR description was generated by GitHub Copilot.

@dotnet-policy-service dotnet-policy-service Bot added the linkable-framework Issues associated with delivering a linker friendly framework label Sep 16, 2026
@jtschuster
jtschuster added this pull request to stack #134091 September 16, 2026 17:44
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jtschuster jtschuster changed the title Integrate ILTrim layout field retention Preserve ILTrim layout fields Sep 16, 2026
@github-actions github-actions Bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Sep 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.

@jtschuster
jtschuster removed this pull request from stack #134091 September 17, 2026 17:27
@jtschuster
jtschuster force-pushed the dev/jtschuster-copilot/ILTrim/layout-field-retention branch from 6d6d8e6 to 6e99ba9 Compare September 17, 2026 17:27
@jtschuster
jtschuster added this pull request to stack #134146 September 17, 2026 17:28

@jkoritzinsky jkoritzinsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need/have tests for structs with layout? What about structs with auto layout (shouldn't have the same requirements).

Comment on lines +30 to +31
return typeDef.Attributes.HasFlag(TypeAttributes.SequentialLayout)
|| typeDef.Attributes.HasFlag(TypeAttributes.ExplicitLayout);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should also support "extended layout" here.

Comment on lines +43 to +44
(declaringTypeMetadata.Attributes.HasFlag(TypeAttributes.SequentialLayout)
|| declaringTypeMetadata.Attributes.HasFlag(TypeAttributes.ExplicitLayout)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
(declaringTypeMetadata.Attributes.HasFlag(TypeAttributes.SequentialLayout)
|| declaringTypeMetadata.Attributes.HasFlag(TypeAttributes.ExplicitLayout)))
LayoutTypeNode.IsLayoutType(declaringTypeDefinition))

Squash accepted iteration-8 slot 1 from aa5683065d2e2c2f0ad6c8684ba709e5c23ed9ec.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e06ebffa-ad53-49ba-b7aa-2efb4ee16d92

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants