<div dir="ltr"><div><div>Hi,<br><br></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">swift-evolution</a> site, also these in the rejected section, that is why I am mailing it to discuss. <br><br></div><div>What is it about? (picture below - code with explanations):<br><br><img alt="Obraz w treÅ›ci 1" src="cid:ii_155b2c9cb6f41a16" height="532" width="420"><br><br></div><div>Conclusion:<br>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><br></div><div>I believe it has no impact on existing code. It will simply start to work.<br><br></div><div>Please let me know what you think about it.<br></div></div>