Hi. I just filed a bug but I want to see if someone knows something about this. I was experimenting with the MeasurementFormatter class presented in the talk 238 of the last WWDC (https://developer.apple.com/videos/play/wwdc2016/238/) and I found that the string() method of this class doesn't take units created from subclasses of Dimensions, like UnitLength. For example, the following code presented in the talk returns an error in Xcode 8 8S128d.
let formatter = MeasurementFormatter()
let distance = Measurement(value: 5, unit: UnitLength.kilometers)
let result = formatter.string(from: distance)
This is an example from the talk, so it should work. The only way I've found to hide the error is to cast the unit as Unit when the Measurement structure is initialized.
let formatter = MeasurementFormatter()
let distance = Measurement(value: 5, unit: UnitLength.kilometers as Unit)
let result = formatter.string(from: distance)
Is this a bug or normal behaviour from now on?
Thanks
JD