Convenience method for testing that type inference works

Given the importance of type inference for performance, perhaps we should check that it's working.

CC @JeffBezanson, @simonster.