compiler: improve `poset_from_mtypes` used for type coloring.