[src] Move focused static initialization to fields - #26264
Conversation
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Convert five assignment-only static constructors to direct field initializers so the compiler can mark their types
beforefieldinit.This updates:
CoreAnimation.CATransform3DCoreGraphics.CGFunctionCoreGraphics.CGPatternCoreVideo.CVPixelFormatDescriptionUIKit.DraggingEventArgsPublic fields modified by the conversion now have useful XML documentation.
Follow-up to #16672.
🤖 Pull request created by Copilot