<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><blockquote type="cite"><div><div dir="ltr"><div>// require value to be of type Bool OR Double OR String OR SomeProtocol</div><div><font face="monospace, monospace">let value: (Bool | Double | String | SomeProtocol)</font></div><div><font face="monospace, monospace">switch value {</font></div><font face="monospace, monospace">&nbsp; &nbsp;case let _ as Bool: …</font><div><font face="monospace, monospace">&nbsp; &nbsp;case let _ as Double: …<br class="">&nbsp; &nbsp;case let _ as String: …<br class="">&nbsp; &nbsp;case let _ as SomeProtocol: …</font></div><div><font face="monospace, monospace">&nbsp; &nbsp;// no default necessary<br></font><div><font face="monospace, monospace">}</font></div></div></div></div></blockquote><br><div>This is a structural union type which has received considerable discussion with commentary from core team members already in the with a subject something like "STL and Either". &nbsp;You may be interested in reading that discussion. &nbsp;The summary is that we are unlikely to see it without extremely compelling use cases.</div></body></html>