The previous use of the virtual `SELFTYPE` on a parameter of `replace` was too restrictive and caused a dynamic crash when replacing something in a `String` by a `FlatBuffer` (for example). This PR uses the more general `Text` as the parameter type, which is already supported by the existing implementation.
The minimal case is not the most useful as doc but I've added it as a unit test anyway:
~~~
var t: Text = "hello"
assert t.replace("hello", new FlatBuffer) == ""
~~~
Pull-Request: #2447