<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div><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;"><span style="font-family: 'helvetica Neue', helvetica;">Fair enough. &nbsp;But in that case I think we want something that does exactly that: rejects classes, rather than indicating value semantics. &nbsp;We need to do this in a way that doesn’t lead to a situation where we used the word `value` to mean “value type”, and later we have the capability to very value semantics and really wish `value` could mean value semantics but that would be a breaking change we aren’t willing to make.</span></blockquote></div><p>Exactly, `any&lt;class&gt;` is just a constraint that indicates which type it can hold, where `any&lt;struct&gt;` or `any&lt;enum&gt;` are two constraints and (not yet existing) counterparts to `any&lt;class&gt;`.</p><p>The idea behind `any&lt;struct&gt;` (or `any&lt;enum&gt;`) might look like this:</p><p>func foo(struct: any&lt;struct, SomeProtocol&gt;)</p><p>Where it is clear that you have to provide a custom struct which conforms to `SomeProtocol`, you’re not constrained to just a single struct, you can build as many as you want it it’s your desire. :)</p></div> <div>Lets just imagine we already have `any&lt;…&gt;` and we also get `oneOf&lt;…&gt;` or `one&lt;…&gt;` which picks only one constraint at compile time and proceeds.</div><div><br></div><div>Here is what you could do for extendable types:</div><div><br></div><div>typealias AnyValue = one&lt;any&lt;struct&gt;, any&lt;enum&gt;&gt;</div><div><br></div><div>func boo(value: any&lt;AnyValue, SomeProtocol&gt;)</div><div><br></div><div>Not sure if we’ll get there or not but its a nice imagination. :)</div><div><br></div><div>I’m not exactly in favor of using `any&lt;class&gt;` instead of AnyClass but I’m openminded. :)</div><div><br></div><div>One problem to solve is the conformance to protocols:</div><div><br></div><div>If we’ll get `any&lt;…&gt;` and depricate `AnyClass` `AnyObject` we cannot do this directly:</div><div><br></div><div>protocol A: any&lt;class&gt; {}</div><div>protocol B: any&lt;ProtocolX, ProtocolY&gt;</div><div><br></div><div>We still need a typealias as a workaround:</div><div><br></div><div>typealias AnyClass = any&lt;class&gt;</div><div>typealias AnyXY = any&lt;ProtocolX, ProtocolY&gt;</div><div><br></div><div>protocol A: AnyClass {} furthermore is this protocol equivalent to protocol A: class {} ???</div><div>protocol B: AnyXY {}</div><br> <div id="bloop_sign_1463812101085146880" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">--&nbsp;<br>Adrian Zubarev<br>Sent with Airmail</div></div> <br></body></html>