<div dir="ltr">For one RealmSwift should likely consider changing their enum cases to use lowerCamelCase like Swift 3 did. Also at some point it should consider the changes to NSError / Swift.Error bridging.<div><br></div><div>-Shawn</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 7, 2016 at 7:18 PM Zhao Xin via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">When I use RealmSwift in my project, I got an alert &quot; &#39;Error&#39; is ambiguous for type lookup in this context&quot;.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default"><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> UIKit</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> UserNotifications</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> WatchConnectivity</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> RealmSwift</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span><br></span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal;color:rgb(112,61,170)"><span style="color:rgb(187,44,162)">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(79,129,135)">AppDelegate</span><span style="color:rgb(0,0,0)">:</span><span>WCSessionDelegate</span><span style="color:rgb(0,0,0)"> {</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span>    </span><span style="color:rgb(187,44,162)">func</span><span> session(</span><span style="color:rgb(187,44,162)">_</span><span> session: </span><span style="color:rgb(112,61,170)">WCSession</span><span>, activationDidCompleteWith activationState: </span><span style="color:rgb(112,61,170)">WCSessionActivationState</span><span>, error: </span><span style="color:rgb(112,61,170)">Error</span><span>?) { </span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><br></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span>





</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span>    }</span></p><div style="font-family:georgia,serif"><span style="font-family:menlo;font-size:11px"> }</span><br></div><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span><br></span></p><p style="margin:0px;line-height:normal"><font color="#000000" face="georgia, serif"><span>I think the reason is that in Swift, Error is a protocol. And in RealmSwift, there is a `</span>case Error(NSError)` in `public enum RealmCollectionChange&lt;T&gt;`.</font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span><br></span></font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span>I managed to eliminate the alert buy change `<span>Error</span><span>?</span>` to `</span><span>Swift</span><span>.</span><span>Error</span><span>?`. Are there any other ways to fix this?</span></font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span><br></span></font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span>Zhaoxin</span></font></p></div></div>
_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
</blockquote></div>