> On Jul 1, 2016, at 2:08 AM, Cao Jiannan via swift-evolution 
> <[email protected]> wrote:
> 
> 
> 
> Hi all,
> 
> I'm now officially proposal the union type feature for Swift. Please see:
> 
> 
> https://github.com/frogcjn/swift-evolution/blob/master/proposals/xxxx-union-type.md
> Introduction
> 
> Add union type grammar, represents the type which is one of other types.
> 
> var stringOrURL: String | URL = "https://www.apple.com";
> 
> 
> I would be thankful if someone support this idea and give some advice. Thanks!

We touch on this in the "commonly proposed" list:

https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md

Disjunctions (logical ORs) in type constraints 
<https://lists.swift.org/pipermail/swift-evolution-announce/2016-June/000182.html>:
 These include anonymous union-like types (e.g. (Int | String) for a type that 
can be inhabited by either an integer or a string). "[This type of constraint 
is] something that the type system cannot and should not support."


-Joe
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to