Skip to content
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]Catch the reasonable mistake 'UnsafeRawMutableBufferPointer' #69909

Closed
wants to merge 5 commits into from
Closed

Conversation

devKobe24
Copy link

Issue: [SR-6360]
Tag: #48910

We could make things easier on people by adding an unavailable typealias with a renamed field.

Resolve: #48910, fix: #69881

devKobe24 and others added 5 commits November 15, 2023 19:54
I restored the code to its original state in 'test/stdlib/UnsafePointerDiagnostics.swift
Issue: [SR-6360]
Tag: #48910

We could make things easier on people by adding an unavailable typealias with a renamed field.

Resolve: #48910, fix: #69881

cc: @glessard
Issue: [[SR-6360](https://bugs.swift.org/browse/SR-6360)]
Tag: #48910

We could make things easier on people by adding an unavailable typealias with a renamed field.

Resolve: #48910, fix: #69881
@devKobe24 devKobe24 requested a review from a team as a code owner November 16, 2023 09:55
@devKobe24
Copy link
Author

@swift-ci Please smoke test

@glessard
Copy link
Contributor

glessard commented Nov 16, 2023

@devKobe24 Thanks for trying again. The typealias from your original contribution was fine, but it should have been in stdlib/public/core/UnsafeRawBufferPointer.swift.gyb. This version outright changes the name of the type, which is not what we want. The right approach is to have the unavailable typealias, then check that we get the expected warning message when compiling a line of code that uses the "wrong" name. The right file for this kind of diagnostic checking is test/stdlib/UnsafePointerDiagnostics.swift.

Also: until the pull request is merged, it's acceptable to keep re-using it by force-pushing your branch to GitHub.

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.

[SR-6360] Catch the reasonable mistake 'UnsafeRawMutableBufferPointer'
2 participants