Beta D 2.068.1-b2

Jacob Carlborg via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Sep 4 07:33:11 PDT 2015


On 2015-09-04 14:04, Martin Nowak wrote:

> 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.
>
> https://github.com/D-Programming-Language/dmd/pull/4606
>
> You should not turn off deprecations btw ;).

I haven't turned off deprecations. This is in Tango and it seems no one 
has cared to fix those.

> 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
> https://github.com/D-Programming-Language/druntime/blob/4e799b75ebcb6d00ccefbcfd763a1f5d158357a1/src/object.d#L1598
> 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.

Again, this is in Tango, I just want it to compile :)

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list