Skip to content

Use a wrapper type instead of retro-conforming FileHandle to TextOutputStream. #290

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

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

allevato
Copy link
Member

TSCBasic has a Windows-only retroactive FileHandle: WritableByteStream
conformance which confers TextOutputStream conformance, conflicting with the
one in our package. Instead of trying to reconcile this across all platforms,
just replace our retroactive conformance with a new wrapper type which can
never conflict with anything from an outside package.

…utputStream`.

TSCBasic has a Windows-only retroactive `FileHandle: WritableByteStream`
conformance which confers `TextOutputStream` conformance, conflicting with the
one in our package. Instead of trying to reconcile this across all platforms,
just replace our retroactive conformance with a new wrapper type which can
never conflict with anything from an outside package.
@allevato
Copy link
Member Author

cc @compnerd (I can't add you directly as a reviewer)

I chose this approach instead of #288 to avoid a fragile retroactive conformance entirely. PTAL and then I'll merge this and cherry-pick it into 5.6, and tag a new release.

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Thanks, this definitely is much better! I assume that this will go to both 5.6 and main.

@allevato allevato merged commit c5bec02 into swiftlang:main Mar 22, 2022
@allevato allevato deleted the filehandle-fixes branch March 22, 2022 17:58
allevato added a commit to allevato/swift-format that referenced this pull request Mar 22, 2022
Use a wrapper type instead of retro-conforming `FileHandle` to `TextOutputStream`.
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