[SR-15627] String(describing:) does not correctly handle Bool wrapped in NSNumber #57923
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Swift 5.5
Xcode 13.2.1
macOS 12.1
Additional Detail from JIRA
md5: a3c7c78c5651e5eb010deee760cefe10
Issue Description:
I expected it to print:
Possible solution: Internally, String(describing:) can first check if the value is NSNumber and if so, do this comparison to check if the underlying value is a Bool:
Lack of this makes debugging more difficult, and also makes it annoying to use JSONSerialization which return Bool values wrapped in NSNumber.
The text was updated successfully, but these errors were encountered: