<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><blockquote type="cite" class=""><div class="">On Nov 11, 2016, at 1:37 PM, Nevin Brackett-Rozinsky via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div dir="ltr" class="">I’ll mention this here since it’s related to tuples and optionals. Starting with this setup:<div class=""><br class=""></div><div class=""><font face="monospace, monospace" class="">var x, y: Int?<br class=""></font></div><div class=""><font face="monospace, monospace" class="">func f() -> (Int, Int) { return (0, 1) }</font></div><div class=""><br class=""></div><div class="">This fails to compile:</div><div class=""><br class=""></div><div class=""><font face="monospace, monospace" class="">(x, y) = f() // Error: Cannot express tuple conversion '(Int, Int)' to '(Int?, Int?)'</font></div><div class=""><br class=""></div><div class="">But this works fine:</div><div class=""><br class=""></div><div class=""><font face="monospace, monospace" class="">func g() -> Int { return 2 }</font></div><div class=""><font face="monospace, monospace" class="">(x, y) = (g(), g())</font></div><div class=""><br class=""></div><div class="">What is going on, why does the first one fail, and is this a bug or does it need a proposal to fix?</div></div></div></blockquote><div><br class=""></div></div>It's a bug. The error message is actually subtly telling you the problem: the type-checker literally can't express the opaque tuple conversion in the AST; when it's a raw tuple expression, it can push the element conversions into the element expressions, but it can't do that with an opaque tuple. It's a silly restriction because of an unfortunate representational decision.<div class=""><br class=""></div><div class="">John.</div></body></html>