-
Notifications
You must be signed in to change notification settings - Fork 789
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
4.1 compiler generates invalid programs for structs which use measure types #2373
Comments
This is related to 0fe9edd - reverting the changes it made prevents the errors described above from happening. I'll investigate further tomorrow. |
@cartermp This is a regression unfortunately |
Noted. Added to the list to document. |
A few more observations:
|
I looked into this a bit more. Here are some other ways that work to fix this:
or
As far as I can see it seems quite specific. I'm making an attempt to fix it here: #2404 |
The combination of a struct, a measure type and no optimization can create incorrect programs which fail verification by peverify, and raise
InvalidProgramException
when run.Repro steps
Take the following code:
Compile the code without optimization using version 4.1 of the F# compiler:
Run the code:
Verify the code:
Expected behavior
Program runs without crashing, and verification with peverify completes without reporting any errors.
Actual behavior
The program crashes with an
InvalidProgramException
, and verification with peverify reports 2 errors.Known workarounds
Either:
Related information
The text was updated successfully, but these errors were encountered: