<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="">Can you raise a bug at <a href="https://bugs.swift.org" class="">https://bugs.swift.org</a>&nbsp;with the details, including the crash dump?<div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Alex</div><div class=""><br class=""><div style=""><blockquote type="cite" class=""><div class="">On 22 Dec 2016, at 02:48, Jun Zhang via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi, everyone.<div class="">&nbsp; &nbsp;I think I found a swift 3 whole module optimization issue. The code below, when building with release configuration and running on an iOS 10 real device, will always causes a crash.</div><div class=""><br class=""></div><div class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace" class="">import UIKit</font><font face="monospace, monospace" class=""><br class=""></font><font face="monospace, monospace" class="">class ViewController: UIViewController {</font><font face="monospace, monospace" class=""><br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; override func viewDidLoad() {<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; super.viewDidLoad()<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; // Do any additional setup after loading the view.<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; super.viewDidLoad()<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; let orderby = "time"<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; let url = "<a href="http://www.sample.com/api/index.php" class="">http://www.sample.com/api/index.php</a>?\(orderby)"<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; Log("Request url: \(url)")<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; if let url = URL(string: url) {<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let request = URLRequest(url: url)<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(request)<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; }<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; }</font><font face="monospace, monospace" class=""><br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; override func didReceiveMemoryWarning() {<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; super.didReceiveMemoryWarning()<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; // Dispose of any resources that can be recreated.<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; }</font><font face="monospace, monospace" class=""><br class=""></font><font face="monospace, monospace" class=""><br class=""></font><font face="monospace, monospace" class="">}</font><font face="monospace, monospace" class=""><br class=""></font><font face="monospace, monospace" class="">func Log(_ log: String) {<br class=""></font><font face="monospace, monospace" class="">&nbsp; &nbsp; // &nbsp; &nbsp;NSLog("%@", log)<br class=""></font><font face="monospace, monospace" class="">}</font></blockquote></div><div class=""><br class=""></div><div class="">You can see the attachment for more detail info.</div><div class="">Or if you use github, this is the repo:&nbsp;</div><div class=""><a href="https://github.com/zaczh/Swift3ClosureDemo" class="">https://github.com/zaczh/Swift3ClosureDemo</a><br class=""></div><div class="">​<br class=""><div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/0B5P4DPGNr-B0RUhTMlFKaFg3Q1k/view?usp=drive_web" target="_blank" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" class=""><img style="vertical-align: bottom; border: none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png" class="">&nbsp;<span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom" class="">Swift3ClosureDemo-master.zip</span></a></div>​<br class=""></div></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>