I am trying to implement some of the methods and properties in NSOrderedSet. 

The read-only property "reversedOrderedSet" has the @NSCopying attribute according to the NSOrderedSet class reference. 

So, I tried to do this: 

@NSCopying public var reversedOrderedSet: NSOrderedSet {

    return NSOrderedSet.init(array: _orderedStorage.reverse())

}


The compiler says "@NSCopying requires the property to be mutable". When inherited by NSMutableOrderedSet, doesn't this property qualify to be mutable? 


Does @NSCopying not apply here? Is my understanding of "mutable (stored) property" flawed? Or is there a problem with the implementation?


Nowhere in Foundation is @NSCopying being used currently. So don't have a "reference implementation" :)



Pushkar N Kulkarni,
IBM Runtimes

Simplicity is prerequisite for reliability - Edsger W. Dijkstra


_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
  • [swift-corelibs-dev] A question ... Pushkar N Kulkarni via swift-corelibs-dev

Reply via email to