add some type inference stuff to the invariant