[swift-evolution] [Proposal] Union Type

Cao Jiannan frogcjn at 163.com
Fri Jul 1 04:06:34 CDT 2016


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>

Hi,

I'm now officially proposal the union type feature for Swift. Please see:


https://github.com/apple/swift/commit/eb7311de065df7ea332cdde8782cb44f9f4a5121 <https://github.com/apple/swift/commit/eb7311de065df7ea332cdde8782cb44f9f4a5121>
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!


--
Jiannan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160701/2b351760/attachment.html>


More information about the swift-evolution mailing list