Esqarrouth/EZSwiftExtensions

Array removeAll() is conflicting with Swift implementation

carlbrusell opened this issue · 4 comments

When I call removeAll() of an array I get "Ambiguous use of 'removeAll' because it has implementation on the Swift.Array and EZSwiftExtensions.Array.

Example code is attached to the issue.
RemoveAllTest.zip

So this happens because removeAll in the EZSwift land takes variadic parameters. This causes conflict in the special case in which the num args = 0.

I added the condition that at least one arg needs to be passed to removeAll and test cases for the same. #436

Thanks @icefall for catching this issue. Feel free to comment on the PR.

@lfarah @goktugyil Can you guys look at this, this is a bug so its high priority.

Merged the change. Resolving now.

A quick fix I did was do:

array = []