Ambiguous use of 'allKeys' error in OS X, Xcode 7.0.1
symonty opened this issue · comments
json.swift:363:26: Ambiguous use of 'allKeys'
json.swift:360:17: Ambiguous use of 'allKeys'
Just migrating code to Xcode 7.0.1 and Swift 2.0 getting a weird error I don't see on iOS but do on OS X?
Try:
- getting a fresh copy via
git clone
- clean the project (cmd+shift+K)
Tired no luck, will ask one of my fellow devs to try tomrrow too.
Must be an apple issue, ran the project from GIT and it works fine, just when the json.swift is in my project it complains, no idea why or what ambiguous even means
Ok if i copy and paste the source it fails, i have a cocoa and a cocoa touch project in one it fails and in the other it does not.
Screenshot shown in playground.
I changed the code to this, and now it works ( i think )
// gives all keys content in JSON object.
public var allKeys:JSON{
if(Array(self._value.allKeys) == []) {
return JSON([])
}
return JSON(Array(self._value.allKeys))
}
This seems to happen when you don't use this as a framework (where it only imports Foundation) and you have Cocoa in your project. .allKeys seems to be defined differently between Foundation and Cocoa. Anyway, that's how I reproduce the error here...
Changing the _value.allKeys to _value.allObjects seems to fix the issue here.