swiftlang-602.0.51.1: Crash finding best solution for return type overload selected via tuple projection

Originator:rix.rob
Number:rdar://20735374 Date Originated:28-Apr-2015 06:01 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (6E14)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
Two functions overloaded on return type, one of which returns a pair of values, the other returns the first element of that pair and calls the other: crash.


Steps to Reproduce:
Compile this:
func f(x: Int) -> Int {
	return f(x).0
}
func f(x: Int) -> (Int, Int) {
	return (0, 1)
}


Expected Results:
Error about ambiguity of .0, or success, or a runtime infinite loop.


Actual Results:
Compiler crash.


Regression:
N/A


Notes:
I’m working around this by using destructuring tuple assignment:

let (v, _) = f(x)
return v

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!