-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix swift build warning - 'default will never be executed' #7419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix swift build warning - 'default will never be executed' #7419
Conversation
@swift-ci please smoke test |
Thanks @hughbe |
@airspeedswift I noticed you added the |
@therealbnut thanks, that's a good workaround. @slavapestov do you know what the deal is with the real fix? Just wondering if we'll lose track without the warning still firing... |
@swift-ci Please test |
want to run a full test rather than just smoke since this is in the unit testing framework... |
@airspeedswift I just found this issue SR-3278, which seems to refer to this code. Perhaps at minimum a new issue should be added for the "real fix"? I had a look but I couldn't find one. |
Thanks for your review :) |
@slavapestov I believe this PR is just waiting for your feedback on @airspeedswift's question, just a reminder, thanks :) |
@airspeedswift The real fix is to not emit the warning about the redundant default statement if the enum is not explicitly marked fixed layout, even in non-resilient builds. However that is a language change, so at the very least it can't happen until we're ready to flip the switch to building the stdlib and related code in Swift 4 mode. |
OK thanks. Will try and remember to put this back when we have that. |
thanks @airspeedswift for reviewing and @slavapestov for your help :) |
There is a build warning when running
utils/build-script
:The
default
case is necessary, but produces a warning in non-resilient builds. This PR keeps thedefault
case, but temporarily removes another (equivalent) case to ensure the switch is: