Starting with beta version 8.3, warnings about the "Line Interpolation" cylinders give a description of debugging for an optional value, did you want to make it explicit? "appeared in my code.
For example, a warning appeared in the following situation up, where the parameters can lead to zero:
let msg = "*** Error \(options["taskDescription"]): cannot load \(sUrl) \(error)"
As previously developed, it was optional for me (and for the compiler) that the options be interpolated as "zero". But the compiler changed his mind.
What the compiler offers is to add a String constructor with a description like this:
let msg = "*** Error \(String(describing: options["taskDescription"])): cannot load \(sUrl) \(error)"
Obviously, the results are clear, but, in my opinion, very cumbersome. Is there a better option? Should I fix all of these warnings or is it better to wait for the next beta?

swift swift3 string-interpolation optional
StΓ©phane de Luca Mar 01 '17 at 22:05 2017-03-01 22:05
source share