You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CS] Formalize param flag handling for imploding params
By default avoid imploding params that have parameter
flags, but carve out exceptions for ownership flags,
which can be thunked, and `@_nonEphemeral` which can
be freely dropped without issue.
tuplify(takesAutoclosure) // expected-error {{cannot convert value of type '(@autoclosure () -> Int, String) -> ()' to expected argument type '(@escaping () -> Int) -> Void'}}
262
+
263
+
func takesInout(_ x:Int, _ y:inoutString){}
264
+
tuplify(takesInout) // expected-error {{cannot convert value of type '(Int, inout String) -> ()' to expected argument type '(Int) -> Void'}}
// Make sure we drop @_nonEphemeral when imploding params. This is to ensure
533
+
// we don't accidently break any potentially valid code.
534
+
letfn=tuplify(takesTwoPointers)
535
+
fn((ptr, ptr))
536
+
537
+
// Note we can't perform X-to-pointer conversions in this case even if we
538
+
// wanted to.
539
+
fn(([1], ptr)) // expected-error {{tuple type '([Int], UnsafePointer<Int>)' is not convertible to tuple type '(UnsafePointer<Int>, UnsafePointer<Int>)'}}
0 commit comments