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

A protocol with a primary associated type (Swift 5.7+) lets you write constrained existentials. What does the type `any Sequence<Int>` mean and how does it differ from `some Sequence<Int>`?

func makeNumbers() -> any Sequence<Int> { [1, 2, 3] } func makeNumbers2() -> some Sequence<Int> { [1, 2, 3] }