Replace unnecessary uses of TraitObject
with casts
#36005
+9
−38
Merged