<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="">The types are clearly different and the current behaviour is fine as it is. <div class=""><br class=""></div><div class="">However, it would be nice to have more support for tuple types in the language. E.g. I’d expect something like this</div><div class=""><br class=""></div><div class=""> <span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">let</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class=""> x = (a:</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">4</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">, b:</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">5</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> let y = x as (m: Int, n: Int)</span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class="">to work (but it doesn’t currently, you have to use forced cast). </span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class="">— Taras</span><br class=""></font><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 05 Feb 2016, at 07:47, Ondrej Barina via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">-1 for proposal. Current behavior is fine. There is no need to change it<br class="">
Ondrej b.<br class="">
</p>
<div class="gmail_quote">On Feb 5, 2016 12:56 AM, "Chris Lattner via swift-evolution" <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
> On Feb 4, 2016, at 3:26 PM, Maximilian Hünenberger <<a href="mailto:m.huenenberger@me.com" class="">m.huenenberger@me.com</a>> wrote:<br class="">
><br class="">
> Is this behavior intended?<br class="">
><br class="">
> What disadvantage do I have if a conversion from (a: Int, b: Int) to (x: Int, y: Int) is allowed?<br class="">
<br class="">
If that were allowed, then it also stands to reason that a conversion from “(a: Int, b : Int)” to “(b: Int, a : Int)” would also work… but would not swap the elements. IMO, it is best to disallow things misleading things like this.<br class="">
<br class="">
-Chris<br class="">
<br class="">
><br class="">
><br class="">
> Thank you for clarification<br class="">
> - Maximilian<br class="">
><br class="">
>> Am 05.02.2016 um 00:11 schrieb Chris Lattner <<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>>:<br class="">
>><br class="">
>><br class="">
>>> On Feb 4, 2016, at 10:57 AM, Maximilian Hünenberger <<a href="mailto:m.huenenberger@me.com" class="">m.huenenberger@me.com</a>> wrote:<br class="">
>>><br class="">
>>> Is there a reasoning behind treating (Int, Int) and (lhs: Int, rhs: Int) as separate types?<br class="">
>><br class="">
>> I’m not sure what you mean by “separate types”. One has labels, one does not, so they are clearly separate.<br class="">
>><br class="">
>> Further, "(Int, Int)” needs to be compatible/convertible to "(a : Int, b : Int)”, but “(a : Int, b : Int)” should not be convertible to “(x : Int, y : Int)”.<br class="">
>><br class="">
>>> Is there a connection to your tuple splat proposal?<br class="">
>><br class="">
>> No connection at all.<br class="">
>><br class="">
>> -Chris<br class="">
>><br class="">
><br class="">
<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></body></html>