swiftlang/swift

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

開放

#48,910 建立於 2017年11月10日

 (4 則留言) (0 個反應) (0 位負責人)Swift (10,719 個分叉)batch import
good first issueimprovementstandard library

倉庫指標

星標
 (69,989 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Previous ID SR-6360
Radar None
Original Reporter @belkadan
Type Improvement
Status In Progress
Resolution
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

貢獻者指南