fix state in local bind#47
Conversation
| body | ||
| >>= fun body -> | ||
| let state = State.restart state diff in | ||
| let state = State.restart state diff0 in |
There was a problem hiding this comment.
To be more symmetrical, I would propose to remove this line,
Indeed, in this case we are restarting from the <?> hole after succeeding at resolving it in
let module M = <?> in <body>
<rest>Thus once we have resolved the body in the extended environment state', we should go back to the starting environment from the <?> hole when resolving <rest>.
There was a problem hiding this comment.
ha! thanks I've updated :)
|
Similarly, for the test I think I will add the single file version module R = struct end
module M = struct let x = 0 end
let () = let module Z = R in ()
let () = let module Z = R in M.xwhere the issue can be detected by the |
|
Thanks for the quick review! I was a bit fixated on the module aliases and didn't notice it was unrelated here... Anyway I've applied your feedback verbatim (but feel free to close that PR if you have your own fix :) ) |
|
Merged, thanks for the report and the fix ! |
Thank you for this amazing project!
I ran into a tiny glitch when playing around, with a spurious "non-resolvable module Y" on the second instance of a
let module M = Y in ...even though the first use of Y resolved correctly. This PR adds a test to document the issue, and the second commit is an attempt to fix it (I think the bug is just a one-character typo, but note that I don't understand the code enough to be sure).