This is what caused the error for me.
Before:
for (key,value) in hash{
count += value.count
}
After:
for (_,value) in hash{
count += value.count
}
It didn't like it that key was never being used anywhere. I am not sure why it should cause the build to fail though.