-
Notifications
You must be signed in to change notification settings - Fork 104
Void function arguments and returns #4088
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db9b4fe
to
33820e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just needs a few more tests.
8000
summary>
33820e2
to
a4ec045
Compare
@dkalinichenko-js thanks for the review! See responses to your comments and the two most recent commits (< 8000 tt>ef4e275, a4ec045). I also rebased but the conflicts were trivial. |
dkalinichenko-js
approved these changes
Jun 23, 2025
mshinwell
pushed a commit
to mshinwell/oxcaml
that referenced
this pull request
Jun 24, 2025
* Void arg/return and %unbox_unit * Promote tests * Disallow void in C stubs * Add void product tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supports
void
function arguments and returns. Also adds%unbox_unit
to create values of layoutvoid
. We still gatevoid
by-extension layouts_alpha
.Implementation
Through typechecking, void is represented as a distinct base sort (as before). In Lambda and Flambda2, terms of layout void are represented as nullary unboxed products, which Flambda was updated to handle in #4083. (Products containing void are products containing empty products, i.e. the tree structure is preserved rather than flattened.)
Testing
The runtime behavior test testsuite/tests/typing-layouts-void/void.ml is adapted from https://github.com/mshinwell/flambda-backend/blob/133dfea83b7eb87dabdb12d2f36bf3836a3dd4bc/up.ml.
Existing tests of
void
should suffice for typing.Reviewing
Several errors change from
to another "Please report this error to the Jane Street compiler team" error. These should all be fixed when we allow
void
in blocks, and should not be problematic becausevoid
is still in alpha with this PR.Stack
Depends on:
Full dependency graph: