Skip to content
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

Remove file-level attributes disabling warning 4 in Flambda 2 #2314

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mshinwell
Copy link
Collaborator

This removes the file-level attributes in the main part of the Flambda 2 codebase that disable the fragile-match warning. In the majority of cases I have made patterns exhaustive rather than just pushing the attributes down onto particular matches. This has cleaned the provers up somewhat; even if they are all a bit verbose, they are at least now consistent.

I made a tiny semantic change in Closure_conversion along the way to propagate information from a Value_int approximation.

Based on #2312

@mshinwell mshinwell added the flambda2 Prerequisite for, or part of, flambda2 label Feb 27, 2024
Copy link
Contributor

@lthls lthls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR is correct, but I'm not very enthusiastic. In my opinion it makes the code harder to read because it's less obvious that the expanded case is a default case. Plus a few instances are really hard to read (a match in a when clause, for instance.)

| Value_approximation.Value_symbol s -> Simple.symbol s
| _ -> simple_var
| Value_symbol s -> Simple.symbol s
| Value_int i -> Simple.const_int i
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this addition. We're creating a simple for the main module block, if it is an integer we have a serious problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe some of these should actually be errors indeed...

@mshinwell
Copy link
Collaborator Author

We will leave out the changes to provers.ml but @lthls will write some "extraction" functions which can be used to rewrite the provers in another way, so the warning can then be enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flambda2 Prerequisite for, or part of, flambda2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants