Merge: core: fix dynamic error on the input type in `Text::replace`