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

[SR-6360] Catch the reasonable mistake 'UnsafeRawMutableBufferPointer' #48910

Open
belkadan opened this issue Nov 10, 2017 · 4 comments
Open
Labels
good first issue Good for newcomers improvement standard library Area: Standard library umbrella

Comments

@belkadan
Copy link
Contributor

Previous ID SR-6360
Radar None
Original Reporter @belkadan
Type Improvement
Status In Progress
Resolution
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement, StarterBug
Assignee None
Priority Medium

md5: 3a178be12fd6e25113883737a47f684b

Issue Description:

I had to write something today using UnsafeMutableRawBufferPointer and accidentally wrote UnsafeRawMutableBufferPointer (switching the "Raw" and the "Mutable"). The current order makes sense because (Unsafe)MutableRawBufferPointer is more similar to (Unsafe)RawBufferPointer than it is to (Unsafe)MutableBufferPointer, but you have to stop and think about that to be sure. We could make things easier on people by adding an unavailable typealias with a renamed field.

@available(*, unavailable, renamed: "UnsafeMutableRawBufferPointer")
typealias UnsafeRawMutableBufferPointer = UnsafeMutableRawBufferPointer
@belkadan
Copy link
Contributor Author

Starter bug instructions: put a test in test/stdlib/UnsafePointerDiagnostics.swift.

@belkadan
Copy link
Contributor Author

Resetting assignee on all Starter Bugs not touched since 2018.

@glessard
Copy link
Contributor

Jordan's suggestion is interesting, but we couldn't possibly do this for every symbol where a common typo can occur. There could perhaps be a pass to try and find a suggestion after compilation fails due to an unknown symbol.

@devKobe24
Copy link

devKobe24 commented Dec 16, 2023

Should I stop the ongoing work related to this project then?

cc: @glessard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment