<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">The case with testVar4 and testVar5 is not exactly a bug—the default implementation of a mutating protocol requirement can reassign 'self' even if the dynamic type turns out to be a class. (I'm not sure <i class="">that's</i>&nbsp;a good feature, but it is the current behavior of Swift 3.) I agree that we should resolve the contradiction at the end somehow, though.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 5, 2016, at 8:39, Charlie Monroe via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">These feel like bugs in the compiler. I'd suggest filing a bug report at&nbsp;<a href="http://bugs.swift.org/" class="">http://bugs.swift.org</a>&nbsp;if others don't think there is more to it...</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 4, 2016, at 12:47 AM, Jakub Skotnicki via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">Hi,<br class=""><br class=""></div>I would like to make a proposal for automatic class-type inference for a variable which conforms to multiple protocols. I have not seen any similar proposals on <a href="https://github.com/apple/swift-evolution" target="_blank" class="">swift-evolution</a> site, also these in the rejected section, that is why I am mailing it to discuss. <br class=""><br class=""></div><div class="">What is it about? (picture below - code with explanations):<br class=""><br class=""><span id="cid:ii_155b2c9cb6f41a16" class="">&lt;swift.png&gt;</span><br class=""><br class=""></div><div class="">Conclusion:<br class="">Multiple protocols constant variable should have its properties mutable if at least one of the protocols is a class-protocol. Firstly, this solves a problem of changing this variable to mutable (with var keyword), which can simply be undesirable, and currently leads to a paradox warning if done on a method parameter. Secondly, it solves a problem of changing specified protocols to class-protocols in order to modify any properties or use mutating function on such variables, which could be an unwanted constrain or it is simply impossible in cases where specified protocols iare also implemented by non-class types.<br class=""><br class=""></div><div class="">I believe it has no impact on existing code. It will simply start to work.<br class=""><br class=""></div><div class="">Please let me know what you think about it.<br class=""></div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>