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
[stdlib] Remove overly-permissive UnsafePointer init #22288
Conversation
@swift-ci please smoke test |
Please test with following pull request: @swift-ci please test linux platform |
@swift-ci please test macOS platform |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve under the assumption that you'll add tests in UnsafePointerDiagnostics.swift something like this:
_ = UnsafePointer<Int>(ps) // expected-error {{error: cannot convert value of type 'UnsafePointer<String>' to expected argument type 'UnsafePointer<_>'}}
_ = UnsafeMutablePointer<Int>(mps) // expected-error {{error: cannot convert value of type 'UnsafeMutablePointer<String>' to expected argument type 'UnsafeMutablePointer<_>'}}
_ = UnsafePointer<String>(pi) // expected-error {{error: cannot convert value of type 'UnsafePointer<Int>' to expected argument type 'UnsafePointer<_>'}}
_ = UnsafeMutablePointer<String>(mpi) // expected-error {{error: cannot convert value of type 'UnsafeMutablePointer<Int>' to expected argument type 'UnsafeMutablePointer<_>'}}
apple/swift-corelibs-foundation#1870 |
@swift-ci Please test macOS platform |
Build failed |
Build failed |
@swift-ci please smoke test and merge |
@swift-ci Please smoke test Linux platform |
The errors were introduced due to apple/swift#22288
Follow-on building on #22275 removing the generic init, leaving only the inits from that PR