<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="">Sure<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 18, 2016, at 4:25 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</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=""><div class="">Good catch. Seems like an issue with the diagnostic. Can you file a bug at <a href="http://bugs.swift.org/" class="">bugs.swift.org</a>?</div><div class=""><br class=""></div><div class="">Jordan</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 18, 2016, at 13:45, David Sweeris via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@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="">I was updating some old code to Swift 2.2, and came across an unexpected tuple splat warning. This code is all you need to generate the deprecation warning:<div class=""><div style="margin: 0px; line-height: normal;" class=""><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Value<T> {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Element = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">T</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Ret = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">T</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Expression<A, R> : </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Value</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">R</span><span style="font-variant-ligatures: no-common-ligatures;" class="">> {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Arg = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">A</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> args: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Arg</span><span style="font-variant-ligatures: no-common-ligatures;" class="">! = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">nil</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">subscript</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(arg: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Arg</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Value</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Ret</span><span style="font-variant-ligatures: no-common-ligatures;" class="">> { </span><span style="font-variant-ligatures: no-common-ligatures;" class="">return</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Op<A, R> : </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Expression</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">A</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">R</span><span style="font-variant-ligatures: no-common-ligatures;" class="">> {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> OpType = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Arg</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Value</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">R</span><span style="font-variant-ligatures: no-common-ligatures;" class="">></span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> op: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">OpType</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(op: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">OpType</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">op</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = op</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">super</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> BinaryOp<A1, A2, R> : </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Op</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">A1</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">A2</span><span style="font-variant-ligatures: no-common-ligatures;" class="">), </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">R</span><span style="font-variant-ligatures: no-common-ligatures;" class="">> {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(op: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">OpType</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">super</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(op: op)</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">subscript</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Arg</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Value</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Ret</span><span style="font-variant-ligatures: no-common-ligatures;" class="">> {</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">return</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">op</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x) </span><span style="font-variant-ligatures: no-common-ligatures;" class="">//Warning: Passing 2 arguments to a callee as a single tuple value is deprecated</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">I don’t understand why the compiler thinks I’m trying to splat the tuple… `op` takes one argument of type `Arg` and I’m giving it one argument of type `Arg`. In the case of a `BinaryOp`, `Arg` does happen to be a tuple, but the proposal (<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0029-remove-implicit-tuple-splat.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0029-remove-implicit-tuple-splat.md</a>) specifically says "it does not propose removing the ability to pass tuples as values to functions”.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Am I missing something, or have I found a bug in Swift 2.2?</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">- Dave Sweeris</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">(PS, Sorry if this is the wrong list… I’m not sure where potential bug reports go.)</span></div></div></div></div>_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>