[swift-evolution] [Review] SE-0023 API Design Guidelines

David Waite david at alkaline-solutions.com
Sat Jan 23 17:41:14 CST 2016


> On Jan 23, 2016, at 12:55 PM, David Sweeris via swift-evolution <swift-evolution at swift.org> wrote:
> 
> +1 on the CamelCase. Just so y’all know, though, there’s a bug in the complier involving naming collisions between cases and types. Currently (Xcode 7.2), case labels silently override type names, leading to the following error:
> enum Foo {
>     case Int            // Ok
>     case Something(Int) // “Error: Use of undeclared type 'Int'"
>     case Float(Double)  // Ok
> }
> 

The error could read better, but the compiler is IMO working properly.

The standard library is an implicitly loaded module called Swift:

enum Foo {
    case Int            // Ok
    case Something(Swift.Int) // Ok
    case Float(Double)  // Ok
}

-DW 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160123/8ce8b4ab/attachment.html>


More information about the swift-evolution mailing list