Tobia
Tobia

Reputation: 18831

Attribute 'explicit_arity' was not used

I'm trying to program using Jane Street's Core standard library and the Reason language frontend.

So I took the corebuild script and saved a copy as recorebuild by replacing ocamlbuild with rebuild. But I'm having trouble with some simple code.

This is the minimal example that fails:

type t = Foo int | Bar;

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

If you try to compile it with the following option, one of the many added by corebuild:

rebuild -tag "ppx(ppx-jane -as-ppx)" test.byte

then you get this error:

File "", line 0:
Attribute `explicit_arity' was not used
Command exited with code 2.

What does it mean?

Upvotes: 2

Views: 193

Answers (1)

glennsl
glennsl

Reputation: 29146

explicit_arity is an attribute emitted by refmt to resolve an ambiguity in the OCaml syntax regarding variants. Unfortunately it conflicts with a Jane St ppx, but it should work if you remove -tag "ppx(ppx-jane -as-ppx)" from the corebuild script.

(Note: This information is taken from the Reason Discord, I don't personally have any experience with this)

Upvotes: 1

Related Questions