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

Given this protocol, how does Swift infer the associated type `Element`?

protocol Producer { associatedtype Element func produce() -> Element } struct IntProducer: Producer { func produce() -> Int { 42 } }