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

--dump-ast: write the same version of AST that was read #79

Closed
aantron opened this issue Aug 23, 2019 · 0 comments
Closed

--dump-ast: write the same version of AST that was read #79

aantron opened this issue Aug 23, 2019 · 0 comments

Comments

@aantron
Copy link
Collaborator

@aantron aantron commented Aug 23, 2019

So, if reading, e.g., a version 4.02 binary AST, writing with --dump-ast should produce a version 4.02 binary AST.

Right now, it produces an AST of whatever compiler version the driver was compiled with.

I believe this is the ultimate place where the decision to write the same version is not made:

| Intf (_, sg) -> Ast_io.Intf ((module OCaml_current), sg)
| Impl (_, st) -> Ast_io.Impl ((module OCaml_current), st)

I guess we would need to note the source version on loading. On writing, we would need to migrate the AST to the target version (instead of to the current version, wherever this is done), and then write that. If the source version is not available (because we read a source file), we can write according to the version with which the driver was compiled, as now.

If this is approved, I can try to make the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.