[mcs] Fix using type relationship check for type parameters. Fixes #18639