Skip to content

Remove optionality from _AttachableImageWrapper.wrappedValue on Windows. #1258

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Aug 9, 2025

This PR makes _AttachableImageWrapper.wrappedValue non-optional on Windows (as it is on Darwin.) As currently implemented, it allows for failures when calling CopyImage() and CopyIcon(), but in practice the only way these can fail is due to heap exhaustion1. Swift treats allocation failures as almost universally fatal, so we should do the same.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

Footnotes

  1. Microsoft's documentation for these functions does not list any other failure modes.

Windows.

This PR makes `_AttachableImageWrapper.wrappedValue` non-optional on
Windows (as it is on Darwin.) As currently implemented, it allows for
failures when calling `CopyImage()` and `CopyIcon()`, but in practice
the only way these can fail is due to heap exhaustion[^msDocs]. Swift treats
allocation failures as almost universally fatal, so we should do the
same.

[^msDocs]: Microsoft's documentation for these functions does not list
any other failure modes.
@grynspan grynspan added this to the Swift 6.x (main) milestone Aug 9, 2025
@grynspan grynspan requested a review from compnerd August 9, 2025 02:26
@grynspan grynspan self-assigned this Aug 9, 2025
@grynspan grynspan added bug 🪲 Something isn't working windows 🪟 Windows support attachments/activities 🖇️ Work related to attachments and/or activities labels Aug 9, 2025
@grynspan
Copy link
Contributor Author

grynspan commented Aug 9, 2025

@swift-ci test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attachments/activities 🖇️ Work related to attachments and/or activities bug 🪲 Something isn't working windows 🪟 Windows support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants