[SR-4929] Support non-inout homogeneous tuple argument conversion to UnsafePointer<Element> #47506
Labels
compiler
The Swift compiler in itself
duplicate
Resolution: Duplicates another issue
feature
A feature request or implementation
swift evolution proposal needed
Flag → feature: A feature that warrants a Swift evolution proposal
Additional Detail from JIRA
md5: 7808dc535688a7e3712964e3bfcd10a8
duplicates:
relates to:
Issue Description:
We should implement implicit conversion from homogeneous tuple arguments to UnsafePointer as follows:
func get(_ p: UnsafePointer<Int>, at index: Int) -> Int {
return p[index]
}
let tuple = (0, 1, 2)
_ = get(tuple, at: 0)
Otherwise, users need to create a mutable copy of the tuple before converting it to a pointer. This is primarily for users working around the absence of fast fixed size arrays in the language.
I'm filing this for completeness, because we want language consistency across all these bugs:
See [SR-3590] Implicitly convert &Tuple to UnsafePointer<Tuple.Element>.
(source breaking in ridiculous cases)
(additive... we don't need to ban the inout syntax)
[SR-4649] "Don't require & to pass value to UnsafeRawPointer", is that it seeks to
(additive)
The text was updated successfully, but these errors were encountered: