Skip to content

Type system support for raw pointer conversion. #3685

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 2 commits into from
Jul 23, 2016
Merged

Type system support for raw pointer conversion. #3685

merged 2 commits into from
Jul 23, 2016

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jul 22, 2016

[Type System] Handle raw pointer conversion.

As proposed in SE-0107: UnsafeRawPointer.
https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md#implicit-argument-conversion

UnsafeMutablePointer<T> -> UnsafeMutableRawPointer
UnsafeMutablePointer<T> -> UnsafeRawPointer
UnsafePointer<T> -> UnsafeRawPointer
UnsafeMutableRawPointer -> UnsafeRawPointer

inout:
&anyVar -> UnsafeMutableRawPointer
&anyVar -> UnsafeRawPointer

array -> UnsafeRawPointer
string -> UnsafeRawPointer

varArray -> UnsafeMutableRawPointer

@atrick
Copy link
Contributor Author

atrick commented Jul 23, 2016

Please test.

@atrick
Copy link
Contributor Author

atrick commented Jul 23, 2016

@swift-ci Please test.

atrick added 2 commits July 23, 2016 10:55
… a type system bug.

<rdar://26058520> Generic type constraints incorrectly applied to functions with the same name

This is exposed by additions to the type system for UnsafeRawPointer.

Warning: unit tests fail very confusingly without this fix.
As proposed in SE-0107: UnsafeRawPointer.
https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md#implicit-argument-conversion

UnsafeMutablePointer<T> -> UnsafeMutableRawPointer
UnsafeMutablePointer<T> -> UnsafeRawPointer
UnsafePointer<T> -> UnsafeRawPointer
UnsafeMutableRawPointer -> UnsafeRawPointer

inout:
&anyVar -> UnsafeMutableRawPointer
&anyVar -> UnsafeRawPointer

array -> UnsafeRawPointer
string -> UnsafeRawPointer

varArray -> UnsafeMutableRawPointer
@atrick atrick changed the title [WIP] Type system support for raw pointer conversion. Type system support for raw pointer conversion. Jul 23, 2016
@atrick
Copy link
Contributor Author

atrick commented Jul 23, 2016

@swift-ci Please smoke test and merge.

@atrick
Copy link
Contributor Author

atrick commented Jul 23, 2016

Interpreter/collection_casts.swift failed. This was from a different commit that wasn't gated on CI.

@atrick atrick merged commit ecc6bd5 into swiftlang:master Jul 23, 2016
@atrick atrick deleted the rawptr-argconv branch September 11, 2016 03:04
kateinoigakukun pushed a commit that referenced this pull request Aug 31, 2022
[pull] swiftwasm from 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.

1 participant