# \[Pitch\] Remove type inference for associated types

**URL:** <https://forums.swift.org/t/pitch-remove-type-inference-for-associated-types/3135>\
**Category:** Pitches\
**Created:** [June 25, 2016, 5:50am UTC](https://forums.swift.org/t/pitch-remove-type-inference-for-associated-types/3135 "2016-06-25T05:50:59Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![dabrahams](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dabrahams/32/9815_2.png) [@dabrahams](https://forums.swift.org/u/dabrahams)\
**Post date:** [June 27, 2016, 7:56pm UTC](https://forums.swift.org/t/pitch-remove-type-inference-for-associated-types/3135/17 "2016-06-27T19:56:56Z")

</div>

Well, the type checker's inference engine has \*always\* been kinda  
unreliable, and the experience is made much worse by the lack of  
recursive protocol requirements and the inability to express other  
constraints that would better guide inference, and by the “underscored  
protocols” such as \_Indexable that are required to work around those  
limitations. IMO it's premature to remove this feature before the  
inference engine is made sane, the generics features are added, and the  
library is correspondingly cleaned up, because we don't really know what  
the user experience would be.

Finally, I am very concerned that there are protocols such as Collection,  
with many inferrable associated types, and that conforming to these  
protocols could become \*much\* uglier.

> **···**
>
> on Sat Jun 25 2016, Austin Zheng \<swift-evolution@swift.org\> wrote:
> 
> > > On Jun 25, 2016, at 6:23 AM, Matthew Johnson \<matthew@anandabits.com\> wrote:
> > > 
> > > Hi Austin,
> > > 
> > > I’m sorry to say, but this proposal makes me really sad. I consider  
> > > associated type inference one of the more elegant aspects of Swift.  
> > > It would be very unfortunate to lose it.
> > 
> > There are lots of "elegant" things that Swift could do, but has chosen  
> > not to do for pragmatic reasons (e.g. generalized implicit  
> > conversions, type inference that crosses statement boundaries). Given  
> > how terrible the development experience can be right now in the worst  
> > case, I would happily trade off some measure of convenience for better  
> > tooling.
> 
> --  
> Dave

---

_[View the full topic](https://forums.swift.org/t/pitch-remove-type-inference-for-associated-types/3135)._
