Use PolyFunction instead of ErasedFunction
#18295
Merged
PolyFunction instead of ErasedFunction
#18295