Skip to content

[src] Move focused static initialization to fields - #26264

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/inline-cctor-src-pr
Jul 28, 2026
Merged

[src] Move focused static initialization to fields#26264
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/inline-cctor-src-pr

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Convert five assignment-only static constructors to direct field initializers so the compiler can mark their types beforefieldinit.

This updates:

  • CoreAnimation.CATransform3D
  • CoreGraphics.CGFunction
  • CoreGraphics.CGPattern
  • CoreVideo.CVPixelFormatDescription
  • UIKit.DraggingEventArgs

Public fields modified by the conversion now have useful XML documentation.

Follow-up to #16672.

🤖 Pull request created by Copilot

Convert five assignment-only static constructors to direct initializers so their types use beforefieldinit.

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

Copilot-Session: 13404517-079a-4812-9632-02a7ddce4903
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces explicit static constructors in several Apple-platform bindings by converting assignment-only static constructors into direct field initializers, enabling the compiler/runtime to treat the types as beforefieldinit (per #16672) and improving documentation on the affected public fields.

Changes:

  • Replaced explicit assignment-only static constructors with static field initializers for 5 types.
  • Added/updated XML documentation for the affected public static fields (including obsolete alias fields).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/UIKit/UIScrollView.cs Converts DraggingEventArgs.True/False initialization to field initializers and improves XML docs.
src/CoreVideo/CVPixelFormatDescription.cs Converts obsolete alias key assignments to field initializers; adds more specific XML docs.
src/CoreGraphics/CGPattern.cs Converts CGPatternCallbacks initialization to a static field initializer (removes explicit cctor).
src/CoreGraphics/CGFunction.cs Converts CGFunctionCallbacks initialization to a static field initializer (removes explicit cctor).
src/CoreAnimation/CATransform3D.cs Converts CATransform3D.Identity initialization to a field initializer and adds XML docs.

Comment thread src/CoreVideo/CVPixelFormatDescription.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rolfbjarne
rolfbjarne marked this pull request as ready for review July 27, 2026 17:50
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner July 27, 2026 17:50
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: de246abfa8babdb7870dc356e88ea6ebb620d092 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #de246ab] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 203 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: de246abfa8babdb7870dc356e88ea6ebb620d092 [PR build]

@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Jul 28, 2026
@rolfbjarne
rolfbjarne enabled auto-merge (squash) July 28, 2026 17:14
@rolfbjarne
rolfbjarne merged commit cdacc18 into main Jul 28, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/inline-cctor-src-pr branch July 28, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants