[Swift 2.2/Xcode 7.3 in Playground] 'Mirror.DisplayStyle' extension to conformance to 'CustomStringConvertible' is deprecated (module 'PlaygroundLogger')
| Originator: | davveston | ||
| Number: | rdar://25540375 | Date Originated: | 05-Apr-2016 01:05 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Swift 2.2/Xcode 7.3 Playground |
| Classification: | Bug | Reproducible: | Always |
Summary: Module 'PlaygroundLogger' contains an extension to the 'Mirror.DisplayStyle' enumeration, to conform to 'CustomStringConvertible', in so including a '.description' for each case in the 'DisplayStyle' enumeration. These descriptions are deprecated and use legacy names (from Swift 1.2 'MirrorDisposition' enumeration) for cases 'Collection', 'Dictionary' and 'Set': names 'IndexContainer', 'KeyContainer' and 'MembershipContainer', respectively. Appropriate descriptors for these cases would simply be 'Collection', 'Dictionary' and 'Set', respectively. Steps to Reproduce: 1. Start a Swift Playground instance with Swift 2.2/Xcode 7.3 and set platform to iOS or OS X. 2. Paste the following code into the Playground code window (2a. imports the 'PlaygroundLogger' module and 2b. prints the 'CustomStringConvertible' descriptors for each case of 'Mirror.DisplayStyle' enumeration): // -------------------------------------------- // import PlaygroundLogger print(Mirror.DisplayStyle.Class) // Class print(Mirror.DisplayStyle.Collection) // IndexContainer <--- print(Mirror.DisplayStyle.Dictionary) // KeyContainer <--- print(Mirror.DisplayStyle.Enum) // Enum print(Mirror.DisplayStyle.Optional) // Optional print(Mirror.DisplayStyle.Set) // MembershipContainer <--- print(Mirror.DisplayStyle.Struct) // Struct print(Mirror.DisplayStyle.Tuple) // Tuple Mirror.DisplayStyle.Class.description // Class Mirror.DisplayStyle.Collection.description // IndexContainer <--- Mirror.DisplayStyle.Dictionary.description // KeyContainer <--- Mirror.DisplayStyle.Enum.description // Enum Mirror.DisplayStyle.Optional.description // Optional Mirror.DisplayStyle.Set.description // MembershipContainer <--- Mirror.DisplayStyle.Struct.description // Struct Mirror.DisplayStyle.Tuple.description // Tuple // -------------------------------------------- // Expected Results: The expected results for printing the cases 'Collection', 'Dictionary' and 'Set' are 'Collection', 'Dictionary' and 'Set', respectively. Actual Results: The actual result for printing the cases 'Collection', 'Dictionary' and 'Set' are the corresponding legacy case names 'IndexContainer', 'KeyContainer' and 'MembershipContainer', respectively. Version: Swift 2.2/Xcode 7.3 Playground run in OS X 10.11, for platform iOS as well as OS X. Notes: For additional details, see the the following StackOverflow thread: http://stackoverflow.com/questions/36413648/ Configuration: Always occurs in Playground, as long as the 'PlaygroundLogger' modules has been imported (which is expected, as this module contains the extension to 'Mirror.DisplayStyle' to conformance to 'CustomStringConvertible' protocol). Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!