On 9/4/15 8:04 AM, Martin Nowak wrote:
On Tuesday, 1 September 2015 at 06:33:30 UTC, Jacob Carlborg wrote:
I suspect this is intended?

The problem is that you're hiding a method that is still reachable
through the vtable.
Rather than throwing a runtime error this was changed to a compiler error.


You should not turn off deprecations btw ;).

The simple solution in you case is to override the inherited `string
toString()` with an implementation that forwards to your `toString()`.

class UniText
     override string toString() { return toString(null).idup; }
     abstract const char[] toString (char[]  dst = null);
     abstract const wchar[] toString16 (wchar[] dst = null);
     abstract const dchar[] toString32 (dchar[] dst = null);

Also see at
for an example of an alternative overridable toString method.
Maybe you should use the delegate based toString as well, it's already
supported by a some phobos formatting.

Why did this compile/pass tests then? I wasn't aware of this restriction.



Reply via email to