<div dir="ltr"><div><h1 style="box-sizing:border-box;margin:0px 0px 16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46)"><font face="arial, helvetica, sans-serif" size="2"><span style="font-weight:normal">Here is my pitch on adding generics to enum cases and not to the enum type itself. Let me know if you have an improvements or modifications lets open it to discussion thank you swiftys! :)</span></font></h1><h1 style="box-sizing:border-box;margin:0px 0px 16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;">Enum with generic cases</h1><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px"><li style="box-sizing:border-box">Proposal: <a href="https://github.com/lostatseajoshua/swift-evolution/blob/master/NNNN-enum-generic-cases.md" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">SE-NNNN</a></li><li style="box-sizing:border-box;margin-top:0.25em">Authors: <a href="https://github.com/alvaradojoshua0" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">Joshua Alvarado</a></li><li style="box-sizing:border-box;margin-top:0.25em">Review Manager: TBD</li><li style="box-sizing:border-box;margin-top:0.25em">Status: <span style="box-sizing:border-box;font-weight:600">PITCH</span></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px"><em style="box-sizing:border-box">During the review process, add the following fields as needed:</em></p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px"><li style="box-sizing:border-box">Decision Notes: <a href="https://lists.swift.org/pipermail/swift-evolution/" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">Rationale</a>, <a href="https://lists.swift.org/pipermail/swift-evolution/" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">Additional Commentary</a></li><li style="box-sizing:border-box;margin-top:0.25em">Bugs: <a href="https://bugs.swift.org/browse/SR-NNNN" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">SR-NNNN</a>, <a href="https://bugs.swift.org/browse/SR-MMMM" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">SR-MMMM</a></li><li style="box-sizing:border-box;margin-top:0.25em">Previous Revision: <a href="https://github.com/apple/swift-evolution/blob/...commit-ID.../proposals/NNNN-filename.md" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">1</a></li><li style="box-sizing:border-box;margin-top:0.25em">Previous Proposal: <a href="https://github.com/lostatseajoshua/swift-evolution/blob/master/XXXX-filename.md" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">SE-XXXX</a></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;"><a id="gmail-user-content-introduction" class="gmail-anchor" href="https://github.com/lostatseajoshua/swift-evolution/tree/master#introduction" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Introduction</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">This proposal adds a change to the enumeration type that allows an enum case to cast a generic on its associated value.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">Swift-evolution thread: <a href="https://lists.swift.org/pipermail/swift-evolution/" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none">Discussion thread topic for that proposal</a></p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;"><a id="gmail-user-content-motivation" class="gmail-anchor" href="https://github.com/lostatseajoshua/swift-evolution/tree/master#motivation" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Motivation</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">Enums currently support generics, but they are added onto the type itself. This can cause adverse syntax when implementing generics for associated values to be stored along each case. The enum case holds the associated value (not the enum type itself) so should create its own value constraints.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;"><a id="gmail-user-content-proposed-solution" class="gmail-anchor" href="https://github.com/lostatseajoshua/swift-evolution/tree/master#proposed-solution" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Proposed solution</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">The generic is to be casted on the case of the enum and not on the enum itself.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;"><a id="gmail-user-content-detailed-design" class="gmail-anchor" href="https://github.com/lostatseajoshua/swift-evolution/tree/master#detailed-design" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Detailed design</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">Current implementation:</p><div class="gmail-highlight gmail-highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px"><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,&#39;liberation mono&#39;,menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal"><span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> enum with two generic types</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">enum</span> <span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">Foo</span>&lt;<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">T</span>: <span class="gmail-pl-e" style="box-sizing:border-box;color:rgb(121,93,163)"><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Hashable</span></span>, <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">U</span>: <span class="gmail-pl-e" style="box-sizing:border-box;color:rgb(121,93,163)"><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Collection</span></span>&gt; {
    <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">case</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span>(<span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(121,93,163)"><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(51,51,51)">obj</span></span>: T)
    <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">case</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">baz</span>(<span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(121,93,163)"><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(51,51,51)">obj</span></span>: U)
}

<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> U is to be casted but it is not even used</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> foo<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> Foo<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&lt;</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>, [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>]<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&gt;</span> <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> .<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span>(<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">obj</span>: <span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span>hash<span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span></span>)

<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> Creating an optional enum, the generics have to be casted without a value set</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> The casting is really not needed as the values should be casted not the enum</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">var</span> foo1<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> Foo<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&lt;</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>, [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>]<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&gt;?</span>

<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> Collections don’t look great either</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">var</span> foos <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> [Foo<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&lt;</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>, [<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>]<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&gt;</span>]()
foos.<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">append</span>(.<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span>(<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">obj</span>:<span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span>hash<span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span></span>))</pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">Proposed solution</p><div class="gmail-highlight gmail-highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px"><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,&#39;liberation mono&#39;,menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal"><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">enum</span> <span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">Foo</span> {
    <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">case</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&lt;</span>T<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Hashable</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&gt;</span>(<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">obj</span>: T)
    <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">case</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">baz</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&lt;</span>U<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Collection</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">&gt;</span>(<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">obj</span>: U)
}

<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> generic type inferred on T</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">var</span> foo<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> Foo <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> .<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span>(<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">obj</span>: <span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span>hash<span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span></span>) 

<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> doesn’t need to cast the generic on the optional enum</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> the associated value will hold the cast</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">var</span> foo1<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> Foo<span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">?</span> 

<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-pl-c" style="box-sizing:border-box">//</span> This also gives better syntax with collections of enums with associated types</span>
<span class="gmail-pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">var</span> foos <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> [Foo]()
foos.<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">append</span>(.<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span>(<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">obj</span>: <span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span>hey<span class="gmail-pl-pds" style="box-sizing:border-box">&quot;</span></span>)</pre></div><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;"><a id="gmail-user-content-source-compatibility" class="gmail-anchor" href="https://github.com/lostatseajoshua/swift-evolution/tree/master#source-compatibility" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Source compatibility</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">This may cause subtle breaking changes for areas in code with generic enum cases. The compiler could help with the change by finding the associated generic and updating the case with the new syntax.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;"><a id="gmail-user-content-alternatives-considered" class="gmail-anchor" href="https://github.com/lostatseajoshua/swift-evolution/tree/master#alternatives-considered" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Alternatives considered</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px">An alternative would be to extend the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,&#39;liberation mono&#39;,menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.0470588);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">associatedtype</code> keyword to the enum type.</p><div class="gmail-highlight gmail-highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,&#39;segoe ui&#39;,helvetica,arial,sans-serif,&#39;apple color emoji&#39;,&#39;segoe ui emoji&#39;,&#39;segoe ui symbol&#39;;font-size:16px"><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,&#39;liberation mono&#39;,menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal"><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">enum</span> <span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">Foo</span> {
    <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">associatedtype</span> T <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Hashable</span>
    <span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">case</span> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">bar</span>(<span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(121,93,163)"><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(51,51,51)">obj</span></span>: T)
}</pre></div></div><div><br></div>Copy of proposal can be found here <a href="https://github.com/lostatseajoshua/swift-evolution/blob/master/NNNN-enum-generic-cases.md">Swift proposal on github</a><div><div><br></div>-- <br><div class="gmail_signature">Joshua Alvarado<div><a href="mailto:alvaradojoshua0@gmail.com" target="_blank">alvaradojoshua0@gmail.com</a></div></div>
</div></div>