-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Corrected code doesn't round-trip" with deriving_inline #338
Comments
Thanks for the report! Time allocated to ppxlib has become a scarce ressource, however I'll do my best to investigate this issue. Sorry in advance for the dealy! |
Hey, thanks for reporting and sorry for the delay! I've just tried to reproduce the problem and am not able to reproduce it. Are you using a mix between |
Indeed, I am using |
Removing the usage of Instead of the above, second dune build and promote changes it to: type t = L1.t [@@deriving_inline leq]
let _ = fun (_ : t) -> ()
let rec (leq : t -> t -> bool) = L1.leq[@@ocaml.warning "-39"]
let _ = leq
[@@@end] Building that fails with the following diff:
That again wants to get rid of those Manually removing to type t = L1.t [@@deriving_inline leq]
let rec (leq : t -> t -> bool) = L1.leq[@@ocaml.warning "-39"]
[@@@end] finally builds successfully and doesn't print any diff. Therefore it seems to me that there's still some inconsistency, because initially The round-tripping error might be orthogonal then and due to some of that |
I have been experimenting with However I haven't managed to reproduce the issue clearly. This is probably hard to test if this is specific to dune running in watch mode. If there's interest I could try to spending more time on this. For now I just wanted to mention that there are still some issues in this area with recent versions of ppxlib (this is with 0.33). |
I'll have to get a bit more familiar with the original error but if you manage to get a reproducible example I'll happily look into it! |
Thanks a lot @NathanReb for offering to help! I added a new commit to the Vcs PR where I discuss some related If you try going through the same steps and let me know what this does for you, with a bit of luck, you might get similar errors! |
Sorry for the long wait, I was on vacation. I'll look into this shortly! |
I have defined a deriver named "leq" with ppxlib, but I guess any ppxlib-based deriver would have the same issue.
First, I use it in a test file as follows:
Second, running dune's build and promote changes it to the following:
This promoted file now refuses to build by giving the following error:
Third, I discovered that removing the
let _
definitions and manually changed the file to the following:Then the round-tripping error disappears, but dune build again suggests a promotion to add the two definitions back, leading back to the second code snippet above.
Therefore I cannot get deriving_inline to a stable state, where it builds without round-trip errors and doesn't keep suggesting additional promotions.
The text was updated successfully, but these errors were encountered: