We should probably add some tests for this function because it once had type unification ghosts, and while adding this new API method, I somehow hit some temporary new ghosts that have since been killed.