My proposal begins on February, still in May. But may no make attention to you. This proposal is more about how to change the way of thinking optional/either type. Change the way of using generic to construct optional/either type.
> 下面是被转发的邮件: > > 发件人: Joe Groff <jgr...@apple.com> > 主题: 回复: [swift-evolution] [Proposal] Union Type > 日期: 2016年7月2日 GMT+8 01:03:17 > 收件人: Cao Jiannan <frog...@163.com> > 抄送: swift-evolution <swift-evolution@swift.org> > >> >> On Jul 1, 2016, at 2:08 AM, Cao Jiannan via swift-evolution >> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> 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 >> >> <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 > <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 swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution