[SR-14146] String(describing:) doesn't respect types refined for Swift #56525
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Target: x86_64-apple-darwin20.3.0
Additional Detail from JIRA
md5: 0454bb06990c4e8c35df50d6ae961891
Issue Description:
If I call
String(describing: )
on an instance of trivial struct type, it prints a call to the constructor. Ex.,(I think this behavior is technically unspecified, but it's a very useful behavior for printing problematic values and then pasting them into playgrounds or unit tests.)
However in the case that the type was refined for Swift, the behavior is a bit odd
prints
e.g. with the unrefined name as the type being constructed, but the refined name of the member.
Ideally, Swift would use the refined name in both places. It's possible to provide custom implementations of the appropriate protocols and then get defined behavior, but for debugging the large universe of C types it's not an ideal situation.
The text was updated successfully, but these errors were encountered: