Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftphantom typesSingle-choice MCQ

This phantom-typed builder uses a state marker. Why does the final call fail?

enum Unsent {} enum Sent {} struct Request<State> { let url: String } extension Request where State == Unsent { func send() -> Request<Sent> { Request<Sent>(url: url) } } let r = Request<Sent>(url: "x") let again = r.send()