start rewriting inference to properly propagate type variables