Jason Hocker Jason Hocker - 2 months ago 50
Swift Question

xcode 8 beta 3: Expected ',' joining parts of a multi-clause condition

Getting a new warning in xcode 8 beta 3. What is wrong with this syntax, or is there a bug in xcode?

SwiftyJSON.swift:772:35: Expected ',' joining parts of a multi-clause condition

if let errorValue = error where errorValue.code == ErrorNotExist {
}

Answer

It seems this feature has been included: 0099-conditionclauses.md

Try this:

if let errorValue = error, errorValue.code == ErrorNotExist {
}