This code works great:
[@bs.deriving abstract] type resultType = {
data: array(array(string)),
error: string
};
let z: resultType = resultType(~data=[|[|"a", "b"|]|], ~error="none");
Js.log(z);
let w = data(z);
Js.log(w);
But this code:
module Results = {
[@bs.deriving abstract] type t = {
data: array(array(string)),
error: string
};
};
let x: Results.t = Results.t(~data=[|[|"a", "b"|]|], ~error="none");
Js.log(x);
let y = Results.t.data(x);
tells me The record field data can't be found.. What am I doing wrong here?