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
Cleaning the project wasn't working for me, this is because I didn't pay attention to the message right above (Xcode highlights only the final command).
In my case it was
:0: error: filename "FileDuplicated.swift" used twice: '/../filepath/FileDuplicated.swift' and '/../filepath/FileDuplicated.swift'
:0: note: filenames are used to distinguish private declarations with the same name
Command /../bin/swiftc failed with exit code 1
I had to change the name of one of the two files and it was solved.
Hope this can help someone, cheers