Skip to content

Add some availability attributes for UnsafePointer conversion. #4064

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
Aug 6, 2016
Merged

Add some availability attributes for UnsafePointer conversion. #4064

merged 1 commit into from
Aug 6, 2016

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Aug 6, 2016

This introduces some important diagnostics to help migration.

Some of the diagnostics that we would like to provide are impossible
on a generic class because they introduce ambiguity.

Renaming UnsafePointer<Void> to UnsafeRawPointer makes extensions and
global operators ambiguous.

We would also like to provide a fix-it on conversion from
UnsafePointer<Void> or UnsafeRawPointer to UnsafePointer<T>
with this message:
Conversion restricted. Use 'assumingMemoryBound(to:)' or 'bindMemory(to:capacity:)'}}

However, that introduces ambiguous overloads that defeat other diagnostics.

This introduces some important diagnostics to help migration.

Some of the diagnostics that we would like to provide are impossible
on a generic class because they introduce ambiguity.

Renaming UnsafePointer<Void> to UnsafeRawPointer makes extensions and
global operators ambiguous.

We would also like to provide this fix-it on conversion from
UnsafePointer<Void> or UnsafeRawPointer to UnsafePointer<T>
with this message:
  Conversion restricted. Use 'assumingMemoryBound(to:)' or 'bindMemory(to:capacity:)'}}

However, that introduces ambiguous overloads that defeat other diagnostics.
@atrick
Copy link
Contributor Author

atrick commented Aug 6, 2016

@swift-ci Please smoke test and merge.

@tkremenek
Copy link
Member

CI testing failed on OS X because of timeout checking out sources from GitHub.

@tkremenek tkremenek merged commit 5e5a623 into swiftlang:swift-3.0-branch Aug 6, 2016
kateinoigakukun added a commit that referenced this pull request Aug 31, 2022
Fix build issues when merging upstream `main`
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