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

Why does this protocol fail to be usable as the existential type `any Flow` in older Swift, requiring a generic instead?

protocol Flow { associatedtype Step func next() -> Step } func drive(_ f: any Flow) { let s = f.next() // what is the type of s? }