Skip to content

Remove optionality from _AttachableImageWrapper.wrappedValue on Windows.#1258

Merged
grynspan merged 1 commit into
mainfrom
jgrynspan/windows-attachable-image-wrapper-nothrow
Aug 11, 2025
Merged

Remove optionality from _AttachableImageWrapper.wrappedValue on Windows.#1258
grynspan merged 1 commit into
mainfrom
jgrynspan/windows-attachable-image-wrapper-nothrow

Conversation

@grynspan

@grynspan grynspan commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

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

grynspan commented Aug 9, 2025

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@grynspan grynspan merged commit f4736a6 into main Aug 11, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/windows-attachable-image-wrapper-nothrow branch August 11, 2025 11:57
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