Skip to content

Preserve coclass generic type fields for AOT - #1810

Merged
Jevan Saks (jevansaks) merged 4 commits into
mainfrom
user/jevansa/coclass-aot-annotation
Sep 2, 2026
Merged

Preserve coclass generic type fields for AOT#1810
Jevan Saks (jevansaks) merged 4 commits into
mainfrom
user/jevansa/coclass-aot-annotation

Conversation

@jevansaks

Copy link
Copy Markdown
Member

Summary

  • Propagate DynamicallyAccessedMembers(PublicFields) to generated coclass CreateInstance<T> helpers when automatic WinRT output marshalling is active.
  • Enable AOT compatibility analysis in the build-task generation tests and promote IL2091 to an error.
  • Add generator regression coverage for the coclass type-parameter annotation.

This fixes Native AOT analysis failures in consumers that call generated helpers such as ShellLink.CreateInstance<T>().

Testing

  • Microsoft.Windows.CsWin32.Tests: 827 passed
  • GenerationSandbox.BuildTask.Tests: 8 passed on net9 and 8 passed on net10
  • Release build,pack with warnings as errors: succeeded with 0 warnings

Enable AOT analysis in build-task tests and verify generated coclass helpers propagate the COM output type annotation.

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

Copilot-Session: 269885ab-a187-403f-81ef-4421f979d78f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 269885ab-a187-403f-81ef-4421f979d78f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 269885ab-a187-403f-81ef-4421f979d78f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 269885ab-a187-403f-81ef-4421f979d78f
@jevansaks
Jevan Saks (jevansaks) merged commit f99b904 into main Sep 2, 2026
20 checks passed
@jevansaks
Jevan Saks (jevansaks) deleted the user/jevansa/coclass-aot-annotation branch September 2, 2026 23:28
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.

2 participants