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

Fix for issue #69 on github: units of measure metadata #72

Closed
wants to merge 3 commits into from

Conversation

andrewjkennedy
Copy link

Metadata for units that is produced by F# 4 cannot be read by F# 3.x tools, because the pickler uses a new form for MeasureRationalPower.

This fixes the problem by ensuring that any normalized unit expression whose exponents are all integers is pickled using the F# 3.x format.

This is issue #69 on github.

… are pickled in a form compatible with F# 3.x tools.

This is issue dotnet#69 on github.

let rec p_measure_intpower unt n st =
match n with
| 0 -> p_byte 4 st
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicating "p_byte 4" is subtle. Factor out a new function called "p_measure_zero". And add a comment that "pbyte 4" is the F# canoncical encoding for MeasureZero.

@dsyme
Copy link
Contributor

dsyme commented Jan 20, 2015

This looks good, thanks for the fix!

@forki
Copy link
Contributor

forki commented Jan 21, 2015

It works for me. :shipit:

andrewjkennedy added 2 commits January 21, 2015 10:34
@latkin latkin closed this in b1c03b6 Jan 22, 2015
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