-
Notifications
You must be signed in to change notification settings - Fork 410
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
"inconsistent assumptions over interface" when compiling ReasonML code with an interface #184
Comments
As far as I can see, interface files .rei are currently ignored. |
I wonder if jBuilder forgot to add the -intf-suffix flag for reason implementation files. This is the symptom you would see. |
It does use
I guess if the intf suffix was |
Looks you all identified the problem. Here's a simple patch that seems to fix the issue for me:
We'll wait for @diml 's input before proceeding. |
The fix looks good to me |
Looking at this again I don't understand how the patch fixes the issue. To check the existence of the mli the compiler does: let sourceintf =
Filename.remove_extension sourcefile ^ !Config.interface_suffix in
if Sys.file_exists sourceintf then begin where It seems to me that we should instead change the naming scheme for intermediate files as follow:
Which is more in line to what we do to handle preprocessors. @TheSpyder dropping the |
I had the same reaction to the patch but figured I was just unfamiliar with the code and intf suffix 😅 |
Ok, I implemented the change and tested it on the archive |
Thanks for the fix! When is the next release? |
I'll do a beta11 on Friday |
Thanks @diml. Much appreciated. |
I'm attaching a simple replication case with 4 files cut down from my real project. It has implementations in both OCaml and Reason (I discovered this while converting my project from OCaml to Reason). The first file defines a type, the second uses that type to define a method and has an interface file, the third file calls that method.
When compiled as OCaml it's fine (
jbuilder build ocaml/Test3.exe
) but when compiling as Reason (jbuilder build reason/Test3.exe
) it gives me an error about inconsistent assumptions:inconsistent.zip
To work around the error,
touch reason/test3.re
and rebuild (perhaps a race condition?). I also tracked down that if thereason/test2.rei
file is deleted a fresh build succeeds.I'm using jbuilder
1.0+beta10
and reason1.13.6
, with compiler4.02.3+buckle-master
although I've also verified it on reason2.0.0
and compiler4.04.2
.The text was updated successfully, but these errors were encountered: