I was trying to convert syntax of old Swift project to new one as per few suggestion on Stack Overflow I tried converting it through Edit > Convert > To latest Synta
In my case it was a compiler flag change that didn't work well. It took a few compiles before it actually started failing though! Xcode caches what it compiles.
Another thing to check:
In my case I had deleted a row in the "Other Swift Flags" section in the Build Settings screen under the Release setting.
That row had been a value for a compiler flag key/value pair. So the key was there but not the value.
Once I deleted the key as well, then the build worked again.