Is there a way to disable "Default will never be used" in a switch statement?

In switch statements in swift, if all the cases are accounted for, the compiler generates a warning indicating that the default case will never be used. On the other hand, it will also give an error if there is no default case and all the possibilities are not covered. Giving a warning when all the cases are already covered can therefore cause the developer to add the default, then remove the default, then add the default, then remove the default, etc. whenever additional cases (e.g. additional enum values) are added.


First, if anyone knows a way to disable this warning please let me know. A longer term fix would be to introduce an additional "level" of error, call it an informational level. This situation could generate an informational message rather than a warning. To me, always adding a default case is more in the realm of "defensive" programming and should not be discouraged with warnings.

If your switch statement covers all the possible values of an enum without a default clause, then you don't need the default. Try removing it and see what happens.

Is there a way to disable "Default will never be used" in a switch statement?
 
 
Q