This commit improves registerAnnotation to use the annotation type rather than a `MergedAnnotation` attribute. See gh-28497