<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">I encounter this error today. "<span style="color:rgb(0,132,0);font-family:Menlo;font-size:11px">matching a protocol value in multiple patterns is not yet supported; use separate cases instead"</span></div><div class="gmail_default" style="font-family:georgia,serif"><span style="color:rgb(0,132,0);font-family:Menlo;font-size:11px"><br></span></div><div class="gmail_default"><font face="georgia, serif" color="#000000">Sample code:</font></div><div class="gmail_default" style="font-family:georgia,serif"><span style="color:rgb(0,132,0);font-family:Menlo;font-size:11px"><br></span></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">import</span> Foundation</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">protocol</span> NameProtocol {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">var</span> name:<span style="color:rgb(112,61,170)">String</span> { <span style="color:rgb(186,45,162)">get</span> }</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">}</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span style="color:rgb(186,45,162)">struct</span><span style="color:rgb(0,0,0)"> Cat:</span>NameProtocol<span style="color:rgb(0,0,0)"> {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">let</span> name:<span style="color:rgb(112,61,170)">String</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">}</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span style="color:rgb(186,45,162)">struct</span><span style="color:rgb(0,0,0)"> Dog:</span>NameProtocol<span style="color:rgb(0,0,0)"> {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">let</span> name: <span style="color:rgb(112,61,170)">String</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">}</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">enum</span> AnimalType {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">case</span> catType(cat:<span style="color:rgb(79,129,135)">NameProtocol</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">case</span> dogType(dog:<span style="color:rgb(79,129,135)">NameProtocol</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">}</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">struct</span> Animal {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">let</span> type:<span style="color:rgb(79,129,135)">AnimalType</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"> </p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">func</span> printName() {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(186,45,162)">switch</span> <span style="color:rgb(79,129,135)">type</span> {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(186,45,162)">case</span><span style="color:rgb(0,0,0)"> .</span><span style="color:rgb(49,89,93)">catType</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(186,45,162)">let</span><span style="color:rgb(0,0,0)"> </span><span style="text-decoration:underline;color:rgb(0,0,0)">a</span><span style="color:rgb(0,0,0)">nimal), </span>// matching a protocol value in multiple patterns is not yet supported; use separate cases instead</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> .<span style="color:rgb(49,89,93)">dogType</span>(<span style="color:rgb(186,45,162)">let</span> animal):</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> <span style="color:rgb(62,30,129)">print</span>(animal.<span style="color:rgb(79,129,135)">name</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> }</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"> }</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">}</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">let</span> cat = <span style="color:rgb(79,129,135)">Cat</span>(name: <span style="color:rgb(209,47,27)">"kitty"</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">let</span> catType = <span style="color:rgb(79,129,135)">AnimalType</span>.<span style="color:rgb(49,89,93)">catType</span>(cat: <span style="color:rgb(79,129,135)">cat</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="color:rgb(186,45,162)">let</span> animal = <span style="color:rgb(79,129,135)">Animal</span>(type: <span style="color:rgb(79,129,135)">catType</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(49,89,93)"><span style="color:rgb(79,129,135)">animal</span><span style="color:rgb(0,0,0)">.</span>printName<span style="color:rgb(0,0,0)">()</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif"><span style="color:rgb(0,132,0);font-family:Menlo;font-size:11px"><br></span></div><div class="gmail_default"><font color="#000000" face="georgia, serif">I am wondering which proposal this is? And will it be implemented in Swift 4.0? I search the error as keywords, but didn't get the expected results.</font></div><div class="gmail_default"><font color="#000000" face="georgia, serif"><br></font></div><div class="gmail_default"><font color="#000000" face="georgia, serif">Zhao Xin</font></div></div>