Missing argument label ‘where’ in call

I am calling the array’s ‘contains’ method, and I keep getting this very frustrating error. I’ve done the legwork, adding the label ‘where’ calls a completely different method. did some preliminary searches and the online community is addressing Other issues unrelated to my issue, because I am comparing apples to apples. here’s the code:

var children : [baseArrObj] = []{
        didSet{
            let rem = children.filter({ oldValue.contains($0) == false })
            let add = oldValue.filter({ children.contains($0) == false })
            ref!.baseUpdated(rem: rem, add: add)
        }
    }

 

I routinely use code just like this to identify the added and removed items in an array. It’s only giving me a headache now, in a playground.

 

this is the error I get on both lines 3 and 4:

Missing argument label ‘where:’ in call

 

if I add that label, I get a completely new set of error as the new method referenced : contains(where:) throws. It’s completely innappropriate for my use, and should be entirely uneccesary.

 

what is really going on here? the types referenced are exactly the same ie: comparable. I am in no way coercing types, and frankly… all of the code i have just written is a sidebar to test a complicated pattern I’m adding to a larger project. I USE MUCH more elaborate code that relies on the “contains()” method with no issues whatsoever.

Powered by WPeMatico

About

You may also like...

Comments are closed.