# Should weak be a type?

**URL:** <https://forums.swift.org/t/should-weak-be-a-type/34032>\
**Category:** Discussion\
**Created:** [February 23, 2020, 3:19pm UTC](https://forums.swift.org/t/should-weak-be-a-type/34032 "2020-02-23T15:19:50Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![John\_McCall](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/john_mccall/32/1351_2.png) [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Post date:** [February 28, 2020, 4:33pm UTC](https://forums.swift.org/t/should-weak-be-a-type/34032/22 "2020-02-28T16:33:53Z")

</div>

With all of that, you could make a property wrapper that duplicated most of the functionality of `weak` and `unowned` without compiler support. However, there is currently no generic constraint that can fully express "is any kind of class reference type"; the `AnyObject` constraint requires the type to have a simple object pointer representation, which precludes non-`@objc` class-bounded protocol and protocol-composition types. Therefore, that wrapper type — and the proposed `Weak<T>` and `Unowned<T>`, for that matter — would not be able to support the full range of types that you can use with `weak` and `unowned` today.

---

_[View the full topic](https://forums.swift.org/t/should-weak-be-a-type/34032)._
