# Make protocols conforming to protocols as only struct/enum/class types can conform to protocols now

**URL:** <https://forums.swift.org/t/make-protocols-conforming-to-protocols-as-only-struct-enum-class-types-can-conform-to-protocols-now/39696>\
**Category:** Pitches\
**Tags:** generics, protocols\
**Created:** [August 25, 2020, 10:57am UTC](https://forums.swift.org/t/make-protocols-conforming-to-protocols-as-only-struct-enum-class-types-can-conform-to-protocols-now/39696 "2020-08-25T10:57:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Nickolas\_Pohilets](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nickolas_pohilets/32/10659_2.png) [@Nickolas\_Pohilets](https://forums.swift.org/u/Nickolas_Pohilets)\
**Post date:** [August 25, 2020, 1:51pm UTC](https://forums.swift.org/t/make-protocols-conforming-to-protocols-as-only-struct-enum-class-types-can-conform-to-protocols-now/39696/3 "2020-08-25T13:51:14Z")

</div>

What you are facing here is a combination of the two known problems -

- [Existential subtyping as generic constraint](https://forums.swift.org/t/existential-subtyping-as-generic-constraint/31584)
- [Should weak be a type? - #22 by John\_McCall](https://forums.swift.org/t/should-weak-be-a-type/34032/22)

> [@Should weak be a type?](https://forums.swift.org/t/should-weak-be-a-type/34032/22):
>
> However, there is currently no generic constraint that can fully express "is any kind of class reference type";

So, in the ideal world, generic signature of your class would look like this:

```swift
class Listeners<ListenerType> where ListenerType: any ListenerProtocol, ListenerType: Referencable {
...
}

```

---

_[View the full topic](https://forums.swift.org/t/make-protocols-conforming-to-protocols-as-only-struct-enum-class-types-can-conform-to-protocols-now/39696)._
