NSOrderedSet does not return proxy objects in Swift

Originator:stephen.groom
Number:rdar://26389791 Date Originated:20-May-2016 02:11 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.3.2
Classification:Other Bug Reproducible:Always
 
Summary:
The documentation and header comments of NSOrderedSet state that the array and set properties return proxy objects that mirror the contents of the underlying ordered set and changes to that set will be reflected in said proxy objects. This does not work as expected in Swift since the returned objects are of the standard Swift Array and Set types.

Steps to Reproduce:
In Swift: create an NSMutableOrderedSet, retrieve the “proxy” array/set objects, mutate the original ordered set.

Expected Results:
The proxy array/set objects should reflect the changes made to the original ordered set.

Actual Results:
The proxy array/set objects are not updated.

Regression:
This appears to be a difference between Swift and Objective-C that the documentation does not disclose.

Notes:
The attached playground demonstrates the problem.

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!