Open Armael opened 7 years ago
I compiled the above without error using eliomc -c
with TyXML 4.1.0.
Can you consider adding additional steps on how to reproduce?
If test.ml
is a file containing the snippet above, then I can reproduce the error by running
ocamlfind ocamlc -package tyxml.ppx -c test.ml
with both Tyxml 4.1.0 and Tyxml master.
Could you give more details of the commands you ran in order to compile with eliomc? I don't know how to reproduce what you mention.
Indeed with that command I have the same issue, I don't know why on the system I was two days ago I could compile test.ml using eliomc -c test.ml
, but the system I am currently on can't compile it that way either.
I don't know if it is useful, but the following gives the same error and sheds some light on what is going on:
open Tyxml
let f contents = Html.body [
Html.a contents;
Html.button contents
]
Html.a expects flow5_without_interactive while Html.button expects phrasing_without_interactive. I believe that flow5_without_interactive should be a supertype of phrasing_without_interactive, but is not compatible in the current implementation.
Well after some more investigation, it appears that my previous comment was inaccurate. The type flow5_without_interactive
is a supertype of phrasing_without_interactive
. However it seems that the OCaml compiler needs a hint to be able to detect it.
open Tyxml
let g contents = Html.body [
Html.a (contents :> Html_types.flow5_without_interactive Html.elt list);
Html.button contents;
]
Surprisingly, the last line fails to typecheck, with the following error: https://paste.isomorphis.me/Tgo