<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="">I’m full -1 on this one. It will make the language inconsistent. How do you explain a new comer that type inference work in some case, but not in other cases, while in both the compiler is completely capable to define the type.<div class=""><br class=""></div><div class="">Why </div><div class=""><br class=""></div><div class="">let myString = "hello" </div><div class=""><br class=""></div><div class="">would be accepted but not </div><div class=""><br class=""></div><div class="">class Foo {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>let myString = "hello" </div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 10 avr. 2017 à 04:05, Daniel Duan via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m still not sure whether *I* want this. But here’s a proposal anyways: <a href="https://gist.github.com/dduan/5017a0b0f0880d014f4ce14c4ca7fb55" class="">https://gist.github.com/dduan/5017a0b0f0880d014f4ce14c4ca7fb55</a><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 7, 2017, at 12:21 AM, Daniel Duan via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi all,<br class=""><br class="">In a discussion about inferring parameter types from default value, Slava brought up some performance problems caused by type inference for stored properties in side types:<br class=""><br class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170313/033882.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170313/033882.html</a><br class=""><br class="">Towards the end, the post mentioned that some Swift team members contemplated requiring types for stored properties in type declarations. I think this idea deserves some more attention. Hence this last minute idea-floating.<br class=""><br class="">In addition to solving a performance headache in implementation, there're always the general benefit of making type declartion more explicit and readable (clarity for reader should out-weigh pleasure of the author). Making the<br class="">language slightly more consistent (we are not inferring types for default parameter values in function anyways).<br class=""><br class="">The cons for doing this are obvious too: the inference makes the language feels more friendly and is, undoubtedly, a beloved feature for many. This would be a source breaking change.<br class=""><br class="">Just thought I'd float the idea to gather some quick reaction. What do y'all think?<br class=""><br class="">Daniel Duan<br class="">_______________________________________________<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></div></blockquote></div><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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></body></html>