<html><body><div>Many thanks. It works in Swift 4 Xcode 9 beta2.</div><div><br>On Jun 30, 2017, at 11:20 AM, Daniel Dunbar <daniel_dunbar@apple.com> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" data-mce-style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This is due to SE-0110:<div class=""> <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0110-distingish-single-tuple-arg.md" class="" rel="noreferrer" data-mce-href="https://github.com/apple/swift-evolution/blob/master/proposals/0110-distingish-single-tuple-arg.md">https://github.com/apple/swift-evolution/blob/master/proposals/0110-distingish-single-tuple-arg.md</a></div><div class="">but see the additional commentary:</div><div class=""> <a href="https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html" class="" rel="noreferrer" data-mce-href="https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html">https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html</a></div><div class=""><br class=""></div><div class="">For now you can rewrite it as:</div><div class="">```</div><div class=""><div class="">let filenamelength = bytes</div><div class=""> .enumerated()</div><div class=""> .map {</div><div class=""> let (index, element) = $0</div><div class=""> return Int(Double(element) * pow(256,Double(index))) }</div><div class=""> .reduce(0, +)</div><div class="">```</div><div class=""><br class=""></div><div class=""> - Daniel</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Jun 29, 2017, at 8:08 PM, CK TUNG via swift-users <<a href="mailto:swift-users@swift.org" class="" data-mce-href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:</div><div class=""><div class=""><div class="">I have the following code snippet that compile OK in swift 3</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;"> bytes = Array(UnsafeBufferPointer(....))</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;"> let filenamelength = bytes[(i+28)..<(i+28+2)]</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;"> .enumerated()</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;"> .map { (index, element) in return Int(Double(element) * pow(256,Double(index))) }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400;"> .reduce(0, +)</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">I have the following code snippet that compile OK in swift 3</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">In Swift 4 (Xcode beta1) it compiled with error something like "... too complex"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">Now in Swift 4 Xocde beta2 the error is </span><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">tuple parameter element does not support destructing</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">what has been changed in swift 4 ?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;"><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">Please help how to solve it ?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;"><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;">Thanks</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;" class="" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008400; min-height: 13px;"><span style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;" class="" data-mce-style="font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; float: none; display: inline !important;"><br class=""></span></div></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="" data-mce-href="mailto:swift-users@swift.org">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div></body></html>