Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwifttype erasureSingle-choice MCQ

Given Swift's opaque vs. existential return types, which statement correctly distinguishes `some Shape` from `any Shape` as a function return type?

protocol Shape { func area() -> Double } func a() -> some Shape { Circle() } func b() -> any Shape { Bool.random() ? Circle() : Square() }