[SR-8464] Attempting to print a function should require the use of String(describing:) #50985
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
Environment
OSX 10.13.4, Swift 4.1.
Additional Detail from JIRA
md5: 2159d86fd9242cba4e2213665cb5c218
Issue Description:
I ran into a scenario that wasn't very nice when transforming a computed property into a function that wasn't very nice and lead to a bug in my code.
I had a computed property `X` on object `A` and I used that computed property in a string using interpolation (`"my computed property is (a.X)"`).
I later transformed X into a function so it became `X(someArg: SomeThing)`.
My old code that used it in string interpolation still built and compiled fine but now resulted in it trying to print the function instead of printing the result of the function call. It would be good if we could require the use of `String(describing🙂` when printing functions in the same way that we require it for printing `Optional`s.
The text was updated successfully, but these errors were encountered: