You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one is beyond me: Amazing uses String(describing: self) in the computed property description. When I try to make Amazing implement CustomStringConvertible, the compiler does not complain, but I run into a BAD EXEC at runtime.
It looks like as this overwrites the default implementation, which I need to access to get the description.
If someone is smart enough to find a way to achieve this, this would be great, as we already are compliant to the protocol. I just don't know how to express this.
I also tried to use String(reflecting: self) in the computed description property instead but this also gives a BAD EXEC at runtime.
The text was updated successfully, but these errors were encountered:
It does not overwrite the default implementation. String(describing: self) simply checks if self conforms to CustomStringConvertible and if it does it will use self.description therefore we will run into a loop resulting in BAD_EXEC.
If self does not conform to CustomStringConvertible, CustomDebugStringConvertible or TextOutputStreamable it will use the Swift Standard Library implementation. I'm unsure if we can (or even should) use the Swift Standard Library implementation directly as it uses internal functions.
This one is beyond me:
Amazing
usesString(describing: self)
in the computed propertydescription
. When I try to make Amazing implementCustomStringConvertible
, the compiler does not complain, but I run into aBAD EXEC
at runtime.It looks like as this overwrites the default implementation, which I need to access to get the description.
If someone is smart enough to find a way to achieve this, this would be great, as we already are compliant to the protocol. I just don't know how to express this.
I also tried to use
String(reflecting: self)
in the computeddescription
property instead but this also gives aBAD EXEC
at runtime.The text was updated successfully, but these errors were encountered: