[mcs] Adding unit test for #18511
[mcs] Fix recursive resolving of crefs (#18511)