Closed chris-wickens closed 8 years ago
I don't think SourceKitten has access to specific type information of a variable, AFAIK you need to actually compile code for that. If anything, I could imagine checking if SourceKitten's "complete" command suggests "isEmpty" on the variable, but I'm unsure as to if and how this is accessible for us in the SwiftLint source code.
+1
I've seen this on my own types where I've added a count
property but not an isEmpty
property. In my use-cases, I opted to simply added the isEmpty
property to my types, but it seems ideal for SwiftLint to first verify whether or not isEmpty
is a thing for that variable.
Unfortunately, neither NSSet or NSOrderedSet have an isEmpty property.