rta: resolve the open-types in a depth-first order to reach limit faster