Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftownership borrowing consumingSingle-choice MCQ

For a noncopyable type (`~Copyable`), what happens at compile time if you pass a value to a `consuming` parameter and then attempt to use that same value afterward in the caller?

struct File: ~Copyable { let fd: Int32 } func close(_ f: consuming File) { /* ... */ } func use() { let f = File(fd: 3) close(f) print(f.fd) // error }