我正在尝试使用Jane Street的Core标准库和Reason语言前端进行编程。

因此,我采取了corebuild脚本,并通过将recorebuild替换为ocamlbuild,将副本另存为rebuild。但是我在一些简单的代码上遇到了麻烦。

这是失败的最小示例:

type t = Foo int | Bar;

let foobar f => switch f {
| Foo x => x
| Bar => 0
};

如果尝试使用以下选项进行编译,corebuild添加的众多选项之一:
rebuild -tag "ppx(ppx-jane -as-ppx)" test.byte

那么你会得到这个错误:
File "", line 0:
Attribute `explicit_arity' was not used
Command exited with code 2.

这是什么意思?

最佳答案

explicit_arityrefmt发出的属性,用于解决OCaml语法中与变体有关的歧义。不幸的是,它与Jane St ppx冲突,但是如果您从-tag "ppx(ppx-jane -as-ppx)"脚本中删除corebuild,它应该可以工作。

(注意:此信息取自Reason Discord,我个人对此没有任何经验)

关于compiler-errors - 未使用属性 'explicit_arity',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46332678/

10-09 17:58