Shevek (shevek) wrote,

[javac] /home/shevek/.../ unreachable statement
[javac] assert false : "Should never have gotten here.";

I know.

If I remove it, I will probably screw up while maintaining the code, and suddenly make it possible to get there. But then I have no assert. Sensible suggestions appreciated.

Update: It's ugly, but: Make the function non-void, make all return points explicit, and make this location be a default return without a value. Then at least I'd get a "Needs return statement" error. I do not intend to do this. Other suggestions appreciated.
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.