Swift: infinite loop converting struct to tuple

Originator:rix.rob
Number:rdar://17315900 Date Originated:14-Jun-2014 03:24 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode6-Beta (6A215l)
Classification:Serious Bug Reproducible:Always
 
Summary:
Converting a struct to a tuple with a conversion function infinite loops.

Steps to Reproduce:
Given these definitions:

import Foundation
extension CGSize {
	@conversion func __conversion() -> (Double, Double) {
		return self
	}
}

Run this code:

let (w, h) = CGSize.zeroSize


Expected Results:
Given that it compiles, I expected it to convert the size into a tuple of doubles unpacked as constants. I expected this to work, too:

let t: (w: Double, h: Double) = CGSize.zeroSize


Actual Results:
Instead it apparently infinite loops and crashes. The crash is evident in the REPL but I can’t figure out how to get a backtrace to tell if it’s infinite looping or what.


Regression:
N/A


Notes:
N/A

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!