# Syntax for existential type as a box for generic type

**URL:** <https://forums.swift.org/t/syntax-for-existential-type-as-a-box-for-generic-type/40751>\
**Category:** Discussion\
**Created:** [September 29, 2020, 1:44pm UTC](https://forums.swift.org/t/syntax-for-existential-type-as-a-box-for-generic-type/40751 "2020-09-29T13:44:22Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![xAlien95](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/xalien95/32/12558_2.png) [@xAlien95](https://forums.swift.org/u/xAlien95)\
**Post date:** [October 8, 2020, 10:42am UTC](https://forums.swift.org/t/syntax-for-existential-type-as-a-box-for-generic-type/40751/11 "2020-10-08T10:42:22Z")

</div>

This is more related to either [Variadic Generics](https://forums.swift.org/t/variadic-generics/20320) or [Unlock Existential Types for All Protocols](https://forums.swift.org/t/unlock-existential-types-for-all-protocols/40665).

In the first case you would have a list of heterogeneous types `T0: View`, `T1: View`, `T2: View`, etc. statically defined on the call site (strawman syntax ahead)

```swift
static func buildBlock<T...: View>(_ c: T...) -> some View { ... }

```

In the second case you would have to use an array having as `Element` type the existential protocol type `any View`

```swift
static func buildBlock(_ c: [any View]) -> some View { ... }

```

in which each element has access to most of the features provided by the `View` protocol.

---

_[View the full topic](https://forums.swift.org/t/syntax-for-existential-type-as-a-box-for-generic-type/40751)._
