<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=""><div class="">Brent Royal-Gordon has written a draft proposal:</div><div class=""><br class=""></div><div class=""><<a href="https://github.com/apple/swift-evolution/pull/218" class="">https://github.com/apple/swift-evolution/pull/218</a>></div></div><br class=""><div><blockquote type="cite" class=""><div class="">On 25 Jul 2017, at 21:58, Gor Gyolchanyan 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=""><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="">This sounds like a challenge 🙂 <div class="">But seriously, seems like straight-up implementing the feature and then wondering whether or not the pull request will be merged in or rejected is an unnecessary gamble, which is why swift-evolution exists.</div><div class="">Haven’t anyone tried to make a proposal for this?</div><div class="">I’d gladly look into implementing it myself if I new for sure that my efforts wouldn’t be wasted.</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 25, 2017, at 11:55 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">There have been a number of discussions on the list in this—Google finds a number of these with a search “swift throwing properties site:<a href="http://lists.swift.org/" class="">lists.swift.org</a>”.<br class=""><br class="">The “tldr” seems to be that it’s not supported because no one has written code to support it yet.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Jul 25, 2017 at 15:29 Gor Gyolchanyan via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">I’ll just cut to the chase:</div><div class="">Why is throwing from <font color="#941751" face="PT Mono" class="">get</font>, <font color="#941751" face="PT Mono" class="">set</font>, <font color="#941751" face="PT Mono" class="">willSet</font> and <font color="#941751" face="PT Mono" class="">didSet</font> disallowed?</div><div class=""><br class=""></div><div class=""><font face="PT Mono" class=""><font color="#941751" class="">var</font> login: <font color="#008f00" class="">String</font> {</font></div><div class=""><font face="PT Mono" class=""><span class="m_3189677645169474559Apple-tab-span" style="white-space:pre-wrap">        </span><font color="#941751" class="">willSet</font> <font color="#941751" class="">throws</font> {</font></div><div class=""><font face="PT Mono" class=""><span class="m_3189677645169474559Apple-tab-span" style="white-space:pre-wrap">                </span><font color="#941751" class="">guard</font> newValue.count > 5 <font color="#941751" class="">else</font> {</font></div><div class=""><font face="PT Mono" class=""><span class="m_3189677645169474559Apple-tab-span" style="white-space:pre-wrap">                        </span><font color="#941751" class="">throw</font> <font color="#008f00" class="">LoginError</font>.loginTooSmall</font></div><div class=""><font face="PT Mono" class=""><span class="m_3189677645169474559Apple-tab-span" style="white-space:pre-wrap">                </span>}</font></div><div class=""><font face="PT Mono" class=""><span class="m_3189677645169474559Apple-tab-span" style="white-space:pre-wrap">        </span>}</font></div><div class=""><font face="PT Mono" class="">}</font></div><div class=""><font face="PT Mono" class=""><br class=""></font></div><div class=""><font face="PT Mono" class=""><font color="#941751" class="">try</font> login = <font color="#0433ff" class="">“JebediahKerman”</font> <font color="#797979" class="">// totally fine</font></font></div><div class=""><font face="PT Mono" class=""><font color="#941751" class="">try</font> login = <font color="#0433ff" class="">“Bob”</font> <font color="#797979" class="">// throws `LoginError.loginTooSmall`</font></font></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></body></html>