> On 17 Jan 2017, at 17:54, Anton Zhilin via swift-evolution 
> <[email protected]> wrote:
> enum Something : RawRepresentable
> With additional typealias RawValue, the simplest cases will lose their 
> elegancy.
> 

While I like the idea of RawRepresentable<Int32>, the use of an associatetype 
seems like the most obvious choice, as it's consistent with other types.
I'm not sure I'd agree that it loses elegance, especially if we can get type 
inference, for example:

        enum Something : RawRepresentable { case .Foo = 1, .Bar = 2 }

Would be equivalent to:

        enum Something : RawRepresentable {
                typealias RawType = Int
                case .Foo = 1
                case .Bar = 2
        }

Just the same as any other type inference really. We could even have the 
RawRepresentable conformance inferred (so you don't have to specify it if you 
set raw values).
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to