iOS Swift Error: 'T' is not convertible to 'MirrorDisposition'
问题 I am attempting to create an extension method for the Array type to allow for removing an item from an array extension Array { func remove(item: AnyObject) { for var i = self.count - 1; i >= 0; i-- { if self[i] == item { self.removeAtIndex(i) } } } } On the test condition if self[i] == item , I get the following error: 'T' is not convertible to 'MirrorDisposition' I've tried many different things, which include: Using generics: remove<T>(item: T) Using the === operator, which just gives the