Skip to content

"module type of" zap modalities to floor#3922

Merged
riaqn merged 5 commits intomainfrom
module-type-of-zap-to-floor
Apr 30, 2025
Merged

"module type of" zap modalities to floor#3922
riaqn merged 5 commits intomainfrom
module-type-of-zap-to-floor

Conversation

@riaqn
Copy link
Copy Markdown
Contributor

@riaqn riaqn commented Apr 24, 2025

module type of M should zap modalities in M to the strongest. This might cause type error where user uses module type of M to constrain another implementation that's weaker than M, which is just bad code. I did some quick check in our internal code base and found such bad code to be rare.

Comment thread typing/typemod.ml
@riaqn riaqn requested a review from dkalinichenko-js April 24, 2025 12:26
@riaqn
Copy link
Copy Markdown
Contributor Author

riaqn commented Apr 24, 2025

@dkalinichenko-js can you look at the updated tests (those with added stateless) if they are correct?

Comment thread testsuite/tests/typing-modes/val_modalities.ml
Comment thread testsuite/tests/typing-modes/val_modalities.ml Outdated
Comment thread testsuite/tests/typing-zero-alloc/signatures.ml
Comment thread testsuite/tests/typing-zero-alloc/signatures.ml
Comment thread testsuite/tests/typing-modes/val_modalities.ml Outdated
@riaqn riaqn enabled auto-merge (squash) April 30, 2025 11:13
@riaqn riaqn merged commit edcc229 into main Apr 30, 2025
26 checks passed
@riaqn riaqn deleted the module-type-of-zap-to-floor branch April 30, 2025 11:40
spiessimon pushed a commit to spiessimon/oxcaml that referenced this pull request Apr 30, 2025
@riaqn riaqn mentioned this pull request May 1, 2025
3 tasks
Gbury pushed a commit to Gbury/flambda-backend that referenced this pull request May 27, 2025
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.

3 participants