Ast_mapper.PpxContext: store type-checking related flags#1921
Ast_mapper.PpxContext: store type-checking related flags#1921gasche merged 2 commits intoocaml:trunkfrom
Conversation
Drup
left a comment
There was a problem hiding this comment.
I agree. The patch looks good.
|
I think it might be useful to also store whether float arrays |
|
|
|
I am slightly confused: is there a check that the invoked ppx |
|
As far as I can tell, there is no such thing today. But it is also not clear how to implement it. When restoring the context inside the ppx binary (the API for that is fixed by |
|
I wonder what you have in mind for flat-float-array, I can imagine that if you are sharing the same ppx binary with different version of the compilers it might be useful. |
|
Well, the thing is if you do not fail explicitly you are accepting If the information is stored in the context and #1589 is merged |
|
What about changing the magic numbers depending on flat-float-array setting? |
cda0df0 to
08c48a5
Compare
|
(I just rebased to add a Changes entry.) |
It is a bug of the current PpxContext that -rectypes is not passed as part of the context: any ppx extension that would like to be able to load .cmi files in the same initial environment as the user code would break because loading -rectypes-using .cmi is disallowed if Clflags.recursive_types is not set. (I found this issue while debugging a ppx_import user that compiles with -rectypes -- ocaml-ppx/ppx_import#25 ) I tried to add all the other Clflags that seem related to type-checking and might cause a program to not-type-check if they are not correctly passed: - recursive_types - principal - transparent_modules - unboxed_types - unsafe_string
It is a bug of the current PpxContext that -rectypes is not passed as
part of the context: any ppx extension that would like to be able to
load .cmi files in the same initial environment as the user code would
break because loading -rectypes-using .cmi is disallowed if
Clflags.recursive_types is not set.
(I found this issue while debugging a ppx_import user that compiles
with -rectypes -- ocaml-ppx/ppx_import#25 )
I tried to add all the other Clflags that seem related to
type-checking and might cause a program to not-type-check if they
are not correctly passed: