Sending a return value to the Mirage server causes a type-error.
E.g. sending the following (protobufs encoded) Mirage-Lambda program
lam {
typ { list { value { abstract { witness: "Cstruct.t" } } } }
var: "inps"
expr {
lam {
typ { list { value { abstract { witness: "Cstruct.t" } } } }
var: "outs"
expr {
val {
value { return { typ { int { } } value { int { value: 42 } } } }
}
}
}
}
}
with the following (protobufs encoded) type
arrow {
a { list { value { abstract { witness: "Cstruct.t" } } } }
b {
arrow {
a { list { value { abstract { witness: "Cstruct.t" } } } }
b { apply { a { int { } } b { lwt { } } } }
}
}
}
(Note, how the expression has type Apply Int Lwt, because the Int value is wrapped in the return value constructor.)
Causes an error with the following log output
Error
error while evaluating:
(fun (inps: Cstruct.t list) -> (fun (outs: Cstruct.t list) -> 42)) []
[(Cstruct.t list -> (Cstruct.t list -> int)) is not compatible with (Cstruct.t list
->
(Cstruct.t list
->
int Lwt.t))].
Sending a
return
value to the Mirage server causes a type-error.E.g. sending the following (protobufs encoded) Mirage-Lambda program
with the following (protobufs encoded) type
(Note, how the expression has type
Apply Int Lwt
, because theInt
value is wrapped in thereturn
value constructor.)Causes an error with the following log output