Swift Compiler on iOS 10 does not properly find MeasurementFormatter.string(from:) method

Originator:curtis.halbrook
Number:rdar://26884071 Date Originated:19-Jun-2016 07:18 PM
Status:Duplicate of 26607639 Resolved:
Product:iOS Product Version:10.0 Beta (14A5261u)
Classification: Reproducible:Always
 
The compiler, when presented the following code:

let fmt = MeasurementFormatter()
let tmp = Measurement(value: 100, unit: UnitTemperature.celsius)
let str = fmt.string(from: tmp)

will sometimes fail to compile with 

Cannot invoke 'string' with an argument list of type '(from: Measurement<UnitTemperature>)'

but will sometimes show

Incorrect argument label in call (have 'from:', expected 'for:')

Steps to Reproduce:
Enter following code into any method in Xcode 8.0 beta (8S128d)

let fmt = MeasurementFormatter()
let tmp = Measurement(value: 100, unit: UnitTemperature.celsius)
let str = fmt.string(from: tmp)

Note you will get either a hard compile error or a Fix-It to change the "from" to "for"

Expected Results:
Successful compile

Actual Results:
Hard compile error or Fix-It suggestion

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!