Add an assertion in the code generator

This was meant to make sure that it was boxed, but instead it actually created an (unrooted) box if something unboxed was passed.