Atdgen help with int8

 cat hello.atd ; atdgen hello.atd 
type my_int = {
  data: int <ocaml repr="Int8.t">;

File "hello.atd", line 2, characters 19-32:
Invalid annotation <ocaml repr="Int8.t">

How do I make this work? I’m trying to define a type my_int that maps to an Int8.t (type I provide) in OCaml and a int8 in Rust (code I am generating).

Here you are defining a record. I think what you want is actually type my_int = int wrap <ocaml module="Int8"> or type my_int <ocaml module="Int8"> = abstract

1 Like