Commits

Jordan Rose committed 29566347dcf
[ClangImporter] Deal with redeclarations of properties as readwrite. (and a similar issue for subscripts) In Cocoa, a property can be declared readonly in the public interface of a class and readwrite in a class extension. Similarly, a protocol can require a readable property, but a category then declares the property as readwrite. Swift doesn't like having two of the same declaration, and which one ended up being used was order-dependent. This change doesn't really fix the problem, but it does paper over it. Now, when the importer sees a redeclaration of a readonly property as readwrite, it forcibly updates the existing property with the new setter. This isn't entirely correct; the redeclaration doesn't show up in its category, and this doesn't respect visibility (i.e. the change to readwrite occurs in a separate module that isn't visible in all source files). (But extensions don't respect visibility in any other way, either, even in pure Swift code.) At its heart, this is just a mismatch between Objective-C allowing redeclarations that add capabilities and Swift not having redeclarations at all. At some point, it may make more sense to model this as an overload, or to mark the original declaration invalid, but for now this seems to be the most contained change we can get that fixes the problem. <rdar://problem/16692921> Swift SVN r16832