在 Vibe.data.json.Json 上使用 Typedef 创建新类型,隐式转换错误

Creating new types using Typedef on Vibe.data.json.Json, implicit conversion error

我需要多种类型的 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 的任何限制。

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

Issue link