1

我需要有多种类型的 Json,所以我使用Typedef如下:

 alias NewType = Typedef!(Json);

我正在使用 Vibe.d Json 版本,编译使用时收到以下消息DMD64 D Compiler v2.072.0

Error: cannot implicitly convert expression ([cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u, cast(ubyte)0u]) of type ubyte[] to void[32]

我阅读了文档并没有发现使用Typedef.

4

1 回答 1

1

这是一个错误,Typedef它似乎无法为使用类型数组的类型命名,从 std_data_json 也void存在同样的问题。JSONValue在这种情况下,我将这一行更改为:https ://github.com/s-ludwig/taggedalgebraic/blob/master/source/taggedalgebraic.d#L58以ubyte键入并且它现在正在工作。我会尝试进一步查看并修复它。

问题链接

于 2016-12-27T19:10:55.790 回答