std.data.json formal review

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 1 04:04:41 PDT 2015


Am 31.07.2015 um 22:15 schrieb Suliman:
> On Friday, 31 July 2015 at 12:16:02 UTC, Sönke Ludwig wrote:
>> Am 31.07.2015 um 10:13 schrieb Suliman:
>>> is the current build is ready for production? I am getting error:
>>>
>>> source\stdx\data\json\value.d(81): Error: safe function
>>> 'stdx.data.json.value.JSONValue.this' cannot call system function
>>> 'std.variant.VariantN!(12u, typeof(null), bool, double, long, BigInt,
>>> string, JSONValue[],
>>> JSONValue[string]).VariantN.__ctor!(typeof(null)).this'
>>
>> 2.068 "fixed" possible safety issues with VariantN by marking the
>> interface @system instead of @trusted. Unfortunately that broke any
>> @safe code using Variant/Algebraic.
>
> Wat revision are usable? I checked some and all have issue like:
>
> source\App.d(5,34): Error: template stdx.data.json.parser.parseJSONValue
> cannot
> deduce function from argument types !()(string), candidates are:
> source\stdx\data\json\parser.d(105,11): stdx.data.json.parser.parseJSONVa
> lue(LexOptions options = LexOptions.init, Input)(ref Input input, string
> filenam
> e = "") if (isStringInputRange!Input || isIntegralInputRange!Input)

parseJSONValue takes a reference to an input range, so that it can 
consume the input and leave any trailing text after the JSON value in 
the range. For just converting a string to a JSONValue, use toJSONValue 
instead.

I'll make this more clear in the documentation.


More information about the Digitalmars-d mailing list