Steven Verheyen
Steven Verheyen

Reputation: 169

Unit tests not compiling - Swift Xcode 9.2

I am learning some TDD for Swift and I came across an issue that Xcode wont compile my test code. I have no clue what could be wrong with this.

Other tests are working fine (also tests for "ListItem" and "Location"). I also closed Xcode many times and cleared Derived Data and even the project itself.

Below the screenshots of code and compile error. If I change the "ListItem" parameter in the method to "Any" (and change the type of the array also), it is compiling. But this is not the code I want without the specific type.

Thanks!

enter image description here

enter image description here

Upvotes: 1

Views: 317

Answers (1)

Steven Verheyen
Steven Verheyen

Reputation: 169

Found the solution here: swift Xcode unit test: Cannot convert value of type "Person" to expected argument type "Person"

Seems that the ItemManager .swift file was not added to the test target of the project (derp)..

Upvotes: 1

Related Questions