Two files: test.d: import std.file; import jsonx; void main() { jsonDecode("bla"); } jsonx.d: import std.conv; import std.variant; T jsonDecode(T = Variant, R)(R input) { auto val = jsonDecode_impl!T(input); return val; } /* Decode anything -> Variant */ Variant jsonDecode_impl(T : Variant, R)(ref R input) { Variant v; v = jsonDecode_impl!real(input); return v; } /* Decode JSON number -> D number */ T jsonDecode_impl(T, R)(ref R input) { try return parse!T(input); catch(ConvException e) throw new JsonException("ConvException: " ~ e.msg); } class JsonException : Exception { this(string s) { super(s); } } dmd test.d json.x: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2089): Error: function std.conv.parse!(real,string).parse compiler error, parameter 'p', bugzilla 2962? Assertion failure: '0' on line 709 in file 'glue.c' I get the same ICE and error using both d-json from http://github.com/gianm/d-json.git and Robert Jacques's new json library. Combine this with std.json's runtime access violations on seemingly correct code and I would almost label this as a blocker.
Edit: Sorry for the missing module declarations that were left out.
(In reply to comment #1) > Edit: Sorry for the missing module declarations that were left out. And `dmd test.d json.x` should be `dmd test.d json.d`
According to http://www.digitalmars.com/d/archives/digitalmars/D/learn/Any_working_JSON_library_for_D2_27727.html this is related or dup of Issue 2962.
Yes, most of the ICE(glue.c) bugs are duplicates of one another. AFAIK there are only 3 independent ones, and of those, one is a simple variation of the other. *** This issue has been marked as a duplicate of issue 2962 ***