[mcs] Convert extended underlying enum constants to their underlying type. Fixes #18866