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
letmoduleM = <?>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>.
Octachron
commented
May 4, 2026
Similarly, for the test I think I will add the single file version moduleR=structendmoduleM=structlet x =0endlet()=letmoduleZ = Rin()let()=letmoduleZ = RinM.xwhere the issue can be detected by the |
art-w
commented
May 4, 2026
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 :) ) |
Uh oh!
There was an error while loading. Please reload this page.
Octachron
commented
May 4, 2026
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).