Reference to generic type index Requires Arguments

The following code gives an error. The error occurs on “var businessIndes: Index!”
It keeps asking me to add < Any>! then once I do it tells me to remove < Any>!
What would be causing this?

var searchController: UISearchController!

var businessSearch = [Business]()

var businessIndex: Index!
let query = Query()
var searchId = 0
var displayedSearchId = -1
var loadedPage: UInt = 0
var nbPages: UInt = 0

The above code compiles just fine with AlgoliaSearch-Client-Swift 4.7 and Xcode 8.2.1 (by using an empty Business class definition). Which versions of the library and Xcode are you using?

There are no generics in the Swift Client, so it is unlikely that the error you described is actually caused by the Index class. The Swift compiler is still far from perfect, and its error reporting can be puzzling at times. Maybe you are just observing a side effect of another error.

I’m using Algolia 4.7 and Xcode 8.2.1 as well. What would you recommend? Also when I Cmd + Click on Index! I get no selection. Shouldn’t it take me to where it is referenced in the Algolia Podfiles?

It seems to be caused by the SwftyJson Pod

See my reply in this conversation.