Open
Description
Description
One of the test-cases introduced by #76834 depends on a type-checker hack that applies only to initializers - https://github.com/swiftlang/swift/blob/main/lib/Sema/CSSimplify.cpp#L9843-L9855. Removal of this hack makes the code ambiguous.
Reproduction
struct View : ~Escapable {
init(_ otherBV: borrowing View) {}
init(_ k: consuming View) {}
}
@lifetime(x)
func getConsumingView(_ x: consuming View) -> View {
return View(x)
}
Without perf hack this produces:
error: ambiguous use of 'init(_:)'
Expected behavior
We need to define expected type/flag matching behavior for borrowing
and consuming
parameters that does not depend on the performance hack(s).
Environment
Swift compiler main branch.
Additional information
No response