Regression test for optimizing that used to crash compiling the `foo` method.