# \[Pitch\] Light-weight same-type constraint syntax

**URL:** <https://forums.swift.org/t/pitch-light-weight-same-type-constraint-syntax/52889>\
**Category:** Pitches\
**Tags:** generics\
**Created:** [October 18, 2021, 10:00pm UTC](https://forums.swift.org/t/pitch-light-weight-same-type-constraint-syntax/52889 "2021-10-18T22:00:27Z")\
**Posts on this page:** 1\
**Showing post:** 44

<div class="post-metadata">

**Author:** ![hborla](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hborla/32/27563_2.png) [@hborla](https://forums.swift.org/u/hborla)\
**Post date:** [November 2, 2021, 7:13pm UTC](https://forums.swift.org/t/pitch-light-weight-same-type-constraint-syntax/52889/44 "2021-11-02T19:13:03Z")

</div>

> [@ksluder](#):
>
> What about opaque types? With [SE-0328](https://github.com/apple/swift-evolution/blob/main/proposals/0328-structural-opaque-result-types.md) now in review, if it is accepted will its implementation bring the expressiveness necessary to support `-> some Collection<Int>` ?

No, SE-0328 is purely to lift the restriction that opaque types can only appear as the top-level result type. It does not add the ability to express constraints on associated types. That said, we absolutely want this syntax to work with opaque types, but we feel like it belongs in a separate proposal. If the community feels differently, that's valuable feedback.

> [@ksluder](#):
>
> Stepping back, this pitch feels like part of a transition the Swift language is making, with the Generics Manifesto as its guiding light, but that the overall route is hazy.

You're right - this pitch is part of an effort to make generic programming in Swift more approachable. I posted a discussion with higher-level goals and directions [here](https://forums.swift.org/t/discussion-easing-the-learning-curve-for-introducing-generic-parameters/52891). This is also a step toward the vision that was laid out in [Improving the UI of Generics](https://forums.swift.org/t/improving-the-ui-of-generics/22814), but focusing on the aspects that design guidance and progressive disclosure into the generic programming experience (contrasted with fully generalizing some of the generic programming features that are rather limited today).

---

_[View the full topic](https://forums.swift.org/t/pitch-light-weight-same-type-constraint-syntax/52889)._
