8000 Change how extension level affects inferred modalities by riaqn · Pull Request #4236 · oxcaml/oxcaml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Change how extension level affects inferred modalities #4236

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

riaqn
Copy link
Contributor
@riaqn riaqn commented Jun 30, 2025

Currently, inferred modalities are fixed to be identity if mode extension is disabled. This causes some incompatibility between modules that has mode enabled and those not. For example, if we have a.ml that has mode enabled, and we have b.ml with mode disabled:

include A

and b.mli:

include module type of A

The later will have non-identity modalities while the former doesn't.

This is currently not testable, since with modules fixed at legacy, the type checker simply copies the modalities from A into B without infering new modalities. But #3759 will be affected.

The solution is to always infer modalties, but use extension level to control what the users can write and read.

@riaqn riaqn requested a review from lukemaurer June 30, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0