[swift-evolution] [Discussion] Enum Leading Dot Prefixes
Jens Persson
jens at bitcycle.com
Fri Feb 12 13:57:55 CST 2016
+1 for this proposal.
/Jens
On Fri, Feb 12, 2016 at 8:18 PM, Jordan Rose via swift-evolution <
swift-evolution at swift.org> wrote:
> Ah, I misread that as you wanting to *enforce* it rather than *allow* it!
> I'm with Joe; we can just consider that a bug. Mind filing it on
> bugs.swift.org?
>
> Jordan
>
> On Feb 12, 2016, at 10:24, David Waite <david at alkaline-solutions.com>
> wrote:
>
> I think you may have misunderstood - I’m asking if we can make your switch
> example into legal code :-)
>
> var point = CGPoint.zero
>
> switch point {
> case .zero: // Error: Enum case 'zero' not found in type 'CGPoint'
>
> -DW
>
> On Feb 12, 2016, at 10:57 AM, Jordan Rose <jordan_rose at apple.com> wrote:
>
>
> On Feb 11, 2016, at 22:27 , David Waite via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Would it be worthwhile to expand this (or create another proposal) to deal
> with switch cases only allowing dot syntax for use with enum cases?
>
>
> I would be against that. I like being able to use static members with
> shorthand.
>
> textField.font = .systemFontOfSize(48)
>
>
> switch point {
> case .zero:
> print("origin")
> case _ where point.x < 0:
> print("negative x")
> default:
> print("uninteresting")
> }
>
>
> Jordan
>
>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
--
bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden
http://www.bitcycle.com/
Phone: +46-73-753 24 62
E-mail: jens at bitcycle.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160212/e554e0b0/attachment.html>
More information about the swift-evolution
mailing list