<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 17 Jan 2017, at 17:54, Anton Zhilin via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div dir="ltr" class=""><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important" class=""><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">enum Something : RawRepresentable</code><br class="">With additional <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">typealias RawValue</code>, the simplest cases will lose their elegancy.</p></div></div></div></blockquote></div><div>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.</div><div>I'm not sure I'd agree that it loses elegance, especially if we can get type inference, for example:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>enum Something : RawRepresentable { case .Foo = 1, .Bar = 2 }</div><div><br class=""></div><div>Would be equivalent to:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>enum Something : RawRepresentable {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>typealias RawType = Int</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>case .Foo = 1</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>case .Bar = 2</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br class=""></div><div>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).</div></body></html>