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

Given this protocol with a default associated type, which conformance is valid and how is `Element` resolved?

protocol Producer { associatedtype Element = Int func make() -> Element } struct A: Producer { func make() -> Int { 0 } } struct B: Producer { func make() -> String { "x" } }