<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 15.05.2016 um 10:57 schrieb Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">I think an important point is that `all&lt;&gt;` should NOT be restricted to having only one reference or value type!</div></blockquote></div><p class="">This is a little problematic and I’m not a compiler expert so from my perspective I could allow that but in a different way you see it (I’ll explain below).</p><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">Ceylon does not have any restrictions like that. You can form the type intersection of String and Integer for example, which are both classes in Ceylon and because Ceylon like Swift only knows single inheritance between classes, the result is simply `Nothing` (the bottom type which has no elements). So there is no need to forbid this explicitly, because the types work out just fine.</div></blockquote></div><p class="">If I remember correctly someone said that `Ceylon` does use `all` and `any` for its Optional?! We can’t to do this in Swift as far as I know our playground.</p><p class="">We don’t have `Nothing` in Swift. The counterpart would be `Optional` but such a type is made explicit by `?` symbol like `Type? == Optional&lt;Type&gt;` and the only equivalent to `Nothing` would be `nil`.</p></div></div></div></blockquote>`Nothing` is the bottom type, i.e. the intersection of all types. It has no members.</div><div>`Nothing` has nothing to do with optionals. Optionals in Ceylon are type unions with the type `Null` which has a single member called `null` (= Swift’s nil).</div><div><br class=""></div><div>Maybe this proposal should start with forbidding creating `All&lt;&gt;` expressions which would evaluate to `Nothing` and a later proposal could introduce the bottom type.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">That been said, if `All&lt;&gt;` would always intersect (what I haven’t proposed here at all) we can’t replace `protocol&lt;&gt;` with `All&lt;&gt;` because if we look at two distinct protocols `A` and `B` and try to merge them into a type `All&lt;A, B&gt;` would resolve in `implicit nil` where the old fashion way is not `protocol&lt;A, B&gt;`. </p></div></div></div></blockquote><div>I don’t know from where you got `implicit nil`. Seems I was a bit unclear :-)</div><div>All&lt;A, B&gt; is the intersection type of A and B, i.e. a type which conforms to A *and* B.</div><div>Only for cases where A and B are *classes* which do *not* share an inheritance relation the result of All&lt;A, B&gt; is `Nothing` (the empty bottom type). This is a special case. The reason is that because of single inheritance it is impossible to define a subtype of two different class hierarchies.</div><div>If A and B are structs the result of All&lt;A, B&gt; is `Nothing` as well, because structs are not subtypeable at all. Note that All&lt;StructA, StructA&gt; will just be StructA, though.</div><div>If at least one of A and B is a protocol it is always possible to define a type that conforms to A and B.</div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">By the way, really an `implicit nil`? This is not a great idea if you ask me.&nbsp;</p><p class="">You may have a look at this document:&nbsp;<a href="https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md" class="">https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md</a></p><p class="">`All&lt;String, Int&gt; == implicit nil` (your way) while it probably `All&lt;String, Int&gt;? == nil` would serve your wished behavior, but again I wasn’t proposing on solving this issue here. I’d like to solve this problem&nbsp;<a href="https://openradar.appspot.com/20990743" class="">https://openradar.appspot.com/20990743</a>&nbsp;and open the door for `AnyStruct`, `AnyEnum`, `AnyValue` (maybe `AnyTuple` someday). This is what your hint for `Any&lt;&gt;` combined with my `All&lt;&gt;` might create.</p><p class="">If we allow multiple reference and value types for `All&lt;&gt;` this will only work with subtypeable types, because as I already described above `All&lt;StructA, StructB&gt;` can’t be merged.</p></div></div></div></blockquote>Yes, as long as subtyping structs is not possible in Swift All&lt;StructA, StructB&gt; would be `Nothing` (again: this is not the type of `nil`).</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">A scenario that will work might look like this:</p><p class="">class A {} &nbsp; &nbsp; class B: A {} &nbsp; &nbsp; class C: B {}</p><p class="">`All&lt;B, C, A&gt;` from the given types and my understanding the compile could and should infer `C` from here (not `B` compared to your example below).</p><div class=""><br class=""></div></div></div></div></blockquote><div><br class=""></div>Oops, sorry, you are right. I again made the error of confusing intersection types (all&lt;&gt;) with union types (any&lt;&gt;). Grrr. I’m used to the type operators, that’s my only excuse…</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">To sum up a little we would have these facts:</p><p class="">- for subtypeable types the compile will search the highest type from the inheritance path and ignore all other lower base types (for `All&lt;A, B&gt;` the compile would infer `B == All&lt;B&gt; == All&lt;B, A&gt;`)</p></div></div></div></blockquote>With `highest` you mean `most specialized`, right? (for me that’s the lowest type :-)</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">- the oder of types should not matter because of the previous fact</p></div></div></div></blockquote>Exactly.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">That been said do we still need the whole inheritance branch inside of `All&lt;&gt;`? I don’t think so.</p></div></div></div></blockquote>Right, the whole branch is definitely not needed.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">Furthermore if we definitely should ignore order of `Types` inside the angle brackets like `All&lt;A, B&gt; == All&lt;B, A&gt;`, because it makes sense from the context of creating a `Type` that is constrained to `A` AND `B` where AND is commutative. I didn’t thought of at first glance, but thanks to your examples it’s clear to me know.</p></div></div></div></blockquote>Yes, `all&lt;&gt;` should be commutative.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><p class="">———</p><p class="">If one would want to store or pass `A` from `class A: ClassB, ProtocolC` in some generic context and we don’t allow a second reference for `All&lt;&gt;` the following sample won’t work (generalized `class` is assumed):</p><p class="">`func &lt;T: class&gt;(value: All&lt;T, ClassB, ProtocolC&gt;)` but you can workaround here `func &lt;T: ClassB&gt;(value: All&lt;T, ProtocolC&gt;)` which can already be done `func &lt;T: ClassB where T: ProtocolC&gt;(value: T)`</p><p class="">The only problem that rises up here is that we can’t store that value inside a non-generic `Type` with both distinct `ClassB` and `ProtocolC` constraints merged together. As you might guess `ProtocolC` is applied onto `A` but not on `B` where `All&lt;ClassB, ProtocolC&gt;` will create a whole new type for us (<a href="https://openradar.appspot.com/20990743" class="">https://openradar.appspot.com/20990743</a>).</p><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">Furthermore you can form type intersections between reference types which inherit from each other. The resulting intersection type is valid and is just equal to the more specific type. And of course you can form type intersections of a reference or value type with itself (i.e. all&lt;SomeClass, SomeClass&gt;).</div></blockquote></div><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">Why should that be useful you may ask?</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">This generality is important when using intersection types with generics: let’s consider the type of a function forming the intersection of two sets with different element types:</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">func union&lt;T, U&gt;(a: Set&lt;T&gt;, b: Set&lt;U&gt;) -&gt; Set&lt;all&lt;T, U&gt;&gt; { … }</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">Requiring all&lt;T,U&gt; to have at most one reference or value type (which must be at first position) would impose some unnecessary restrictions:</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">Given the following:</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">protocol Named {}</div><div class="" style="font-family: 'helvetica Neue', helvetica;">class Person : Named {}</div><div class="" style="font-family: 'helvetica Neue', helvetica;">class Employee : Person {}</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">let people: Set&lt;Person&gt;</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let otherPeople: Set&lt;Person&gt;</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let employees: Set&lt;Employee&gt;</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let namedOnes: Set&lt;Named&gt;</div><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">// unnecessary restriction:</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let x1 = union(namedOnes, people) &nbsp;// not allowed, because result type contains all&lt;Named, Person&gt;&nbsp;</div></blockquote></div><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">// the restriction would require us to write:</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let x2 = union(people, namedOnes) &nbsp;// ok, result type would be Set&lt;all&lt;Person, Named&gt;&gt; which would be simplified by the compiler to Set&lt;Named&gt; </div></blockquote></div></div></div></div></div></div></div></blockquote><div><br class=""></div>Correction: Set&lt;all&lt;Person, Named&gt;&gt; = Set&lt;Person &amp; Named&gt; = Set&lt;Person&gt;</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">(Ceylon does this!)</div></blockquote></div><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">// unnecessary restriction:</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let x3 = union(people, employees) &nbsp; // not allowed, because result type would contain all&lt;Person, Employee&gt; with two reference types</div></blockquote></div><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">// unnecessary restriction</div><div class="" style="font-family: 'helvetica Neue', helvetica;">let x4 = union(people,&nbsp;otherPeople) &nbsp; // not allowed, because result type contains all&lt;Person, Person&gt; with two reference types</div></blockquote></div><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">IMO these should all be allowed (and are possible in Ceylon).&nbsp;</div><div class="" style="font-family: 'helvetica Neue', helvetica;">The result type of x1 would be Set&lt;all&lt;Named, Person&gt;&gt; which would be simplified by the compiler to Set&lt;Named&gt;.</div></blockquote></div></div></div></div></div></div></div></div></div></blockquote><div><br class=""></div>Correction: Set&lt;Person&gt;</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">The result type of x2 would be Set&lt;all&lt;Person, Named&gt;&gt; which would be simplified by the compiler to Set&lt;Named&gt;.</div></blockquote></div></div></div></div></div></div></div></div></div></blockquote><div><br class=""></div>Correction: again Set&lt;Person&gt;</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;">The result type of x3 would be Set&lt;all&lt;Person, Employee&gt;&gt; which would be simplified by the compiler to Set&lt;Employee&gt;.</div><div class="" style="font-family: 'helvetica Neue', helvetica;">The result type of x4 would be Set&lt;all&lt;Person, Person&gt;&gt; which would be simplified by the compiler to Set&lt;Person&gt;.</div></blockquote></div></div></div></div></div></div></div></div></div></blockquote><div><br class=""></div>These two are correct, at least…</div><div><br class=""></div><div>Sorry again for the confusion!</div><div><br class=""></div><div>-Thorsten</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: 'helvetica Neue', helvetica;"><br class=""></div><div class="" style="font-family: 'helvetica Neue', helvetica;">-Thorsten</div></blockquote><br class="Apple-interchange-newline"></div>Pleas rethink your example here, `Intersection&lt;&gt;` might be a proposal of its own (there are some problems with `Nothing` I described above).</div></div></div></div></div></div><div class=""><br class=""></div><div class="">———&nbsp;</div><div class=""><br class=""></div><div class="">`Any&lt;&gt;` will pick only one type from its angle brackets. The types must be distinct to each other, but `Any&lt;&gt;` is a whole other proposal which has its own problems like:</div><div class=""><br class=""></div><div class="">protocol A {} &nbsp; &nbsp;protocol B {} &nbsp; &nbsp; class C: A, B {}</div><div class=""><br class=""></div><div class="">func foo(value: Any&lt;A, B&gt;) {</div><div class="">&nbsp; &nbsp; &nbsp;// if else if won’t handle `value` correctly if it’s `C`</div><div class="">}</div><div class=""><br class=""></div><div class="">Is such a thing intended? I guess `Any&lt;&gt;` should just proceed when the first match is found at compile time and it’s up to the developer to handle `value` correctly.</div><div class=""><br class=""></div><div class="">In different thread I just answered my vision for `All&lt;&gt;` and future `Any&lt;&gt;`:</div><div class=""><br class=""></div><div class=""><div class="">There are two future directions in my proposal:&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;(1) `Any&lt;&gt;` which takes only one type from the angle brackets: `Any&lt;String, Int&gt;` or `String | Int`</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;(2) if we already have a generalized `class` keyword, so why we don’t get `struct` and `enum` as well?</div><div class=""><br class=""></div><div class="">With this we can create a typealias for `AnyValue` like this (at least for generalized extendable types):&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;`typealias AnyStruct = All&lt;struct&gt;`</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;`typealias AnyEnum = All&lt;enum&gt;`</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;`typealias AnyValue = Any&lt;All&lt;struct&gt;, All&lt;enum&gt;&gt;`</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;`typealias AnyValue = AnyStruct | AnyEnum`</div></div><div class=""><br class=""></div></div><div id="bloop_sign_1463297249978238976" class="bloop_sign" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="font-family: helvetica, arial; font-size: 13px;" class="">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>