Files
swift-mirror/test/SILGen/unmanaged-chain.swift
Joe Groff 38d4622d24 SILGen: Bug fix handling consuming/borrowing parameters and optional chaining.
Make sure we remove the `@moveOnly` marker while projecting the payload as expected
for the (no longer non-implicitly-copyable) projected result. Fixes rdar://116127887.
2024-05-15 16:57:40 -07:00

16 lines
448 B
Swift

// RUN: %target-swift-emit-silgen -verify %s
extension Unmanaged {
func something1(with x: consuming Unmanaged<Instance>?) -> UnsafeMutableRawPointer? {
x?.toOpaque()
}
func something2(with x: consuming Unmanaged<Instance>?) -> UnsafeMutableRawPointer? {
let y = x
return y?.toOpaque()
}
func something3(with x: __owned Unmanaged<Instance>?) -> UnsafeMutableRawPointer? {
x?.toOpaque()
}
}