You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe we should use the [@@@ocaml.ppwarning] attribute. It is documented as the one to use in preprocessor.
gospel pps should then turn the middle.mli file into something like:
#1"middle.mli"
[@@@ocaml.ppwarning "Gospel specification in the wrong place"]
#3"middle.mli"valf : int ->
(*@ y = f x *)int
And we will have:
$ ocamlc.opt middle.mli
File "middle.mli", line 2, characters 20-61:
2 | [@@@ocaml.ppwarning "Gospel specification in the wrong place"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning 22 [preprocessor]: Gospel specification in the wrong place
Sidenote: unfortunately, ppwarning will trigger a warning during OCaml typing, not parsing. And gospel relies only on parsing. So if we generate such a warning, it won’t appear in a gospel check. 🤔
Given the following source file
middle.mli
with a Gospel specification appearing at an improper location (in the middle of a type):the user will see an error reported against the generated part of the file:
It would be nicer to be able to detect such cases and turn them into a
[@@@ocaml.warning
similar to OCaml warning 50.The text was updated successfully, but these errors were encountered: