Fix make_mono_id to take into account self types. Closes #7536.

r?