<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Hi Swift community, I have a question.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">This is a valid Swift code:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">func testFunc(times: Int, fn: ((Int)->Void)? = nil) {</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>guard let f = fn else { return }</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>for i in 1 ..< times {</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">                </span>f(i)</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">And this is not:</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">func testFunc(times: Int, @noescape fn: ((Int)->Void)? = nil) {</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>guard let f = fn else { return }</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>for i in 1 ..< times {</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">                </span>f(i)</div><div id="bloop_customfont" style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div id="bloop_customfont" style="margin: 0px;">}</div><div><br></div><div>I can't think of any hard reason why the @noescape parameter of the function can't be nullable (and, with default value, be optional), but maybe I'm missing something. Is there any plan to correct this in 3.0?</div><div><br></div><div>Alex</div></div></div></body></html>