utils: Validate the type fragment
If we find a link to a valid type, but with the wrong fragment, we will
end up creating an invalid link, unless the generic type
fragment is
used. To avoid this case, we are going to evaluate the fragment against
the expected one given the resolved type.