Appender example doesn't work with GDC. GDC bug?

rikki cattermole rikki at cattermole.co.nz
Sat Dec 28 03:45:04 UTC 2019


On 28/12/2019 4:30 PM, Adam D. Ruppe wrote:
> On Saturday, 28 December 2019 at 03:08:48 UTC, BoraxMan wrote:
>> For the line "Writeln(w[]);" GDC reports "error: no [] operator 
>> overload for type Appender!string".
> 
> I think that is just a broken example. Pretty sure it should be `w.data` 
> instead of `w[]`.

This was added 5 months ago.

The example is correct.

https://github.com/dlang/phobos/commit/fbbdb721a5424748a485b5b8425e986fff4511a1

FYI: the current version of gdc exists mostly to bootstrap future 
versions of gdc (because of rules surrounding gcc).

You will get instances like this where your gdc build will be severely 
out of date. I would not recommend it for a new(-ish) user as of this 
moment.


More information about the D.gnu mailing list