Use correct zap function for modalities in with module constraints#2767
Use correct zap function for modalities in with module constraints#2767goldfirere merged 4 commits intooxcaml:mainfrom
zap function for modalities in with module constraints#2767Conversation
|
In the following example, both and I can see that |
|
Following the last comment, I now think that it makes sense that If we On the other hand, if the user write |
|
Apologize for delaying the promised fix. I will do this ASAP. |
|
OK to implement what I suggested would require some extra work. Currently when people write To fix this properly, we probably need to modify I suggest that for now we merge this PR as it is. I will resolve conflict and push. |
…odule` constraints (oxcaml#2767) * commit test with spurious type error * Zap modalities in a better way * Add some more tests documenting the behavior. * fix spurious test failure
This fixes a bug in #2764, which "fixed" a bug in #2742.
The original bug was that
zero_allocand modality variables could creep into signatures in a disallowed way when using awith moduleconstraint. The fix was to make these variables into constants in the computed signature for the constraint. But in the case of modality variables, I picked a constant that could lead to spurious typing errors, and failed to notice it because we only create these variables if-extension mode_alphais used.There are three commits:
(There remain some questions about whether the revised behavior is ideal, and the tests in the third commit document the behavior.)