Two problems with json and lcd
Petar
Petar
Tue Feb 18 22:00:25 UTC 2020
On Tuesday, 18 February 2020 at 18:05:43 UTC, AlphaPurned wrote:
> json has two issues, it doesn't work with tuple:
>
> (isArray!T)
>
> goes to
>
> (isArray!T || (T.stringof.length > 4 && T.stringof[0..5] ==
> "Tuple"))
>
> and right below
>
> else
> {
> static assert(false, text(`unable to convert type
> "`, T.Stringof, `" to json`));
> }
>
> and it used Stringof.
>
>
>
> This fixes json to work with tuples.
>
> Second, LCD gives me the error:
>
> error : function `Test.main.rate!(d, "", "").rate` cannot
> access frame of function `Test.main.__foreachbody1`
>
> Not sure the problem, works fine with DMD. I'm simply accessing
> a variable outside a templated function.
I didn't understand your first point, but if I got the gist of
your second one, the difference may be due to LDC not yet having
implemented this:
https://github.com/ldc-developers/ldc/issues/3125
More information about the Digitalmars-d-learn
mailing list