Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006451OCaml~DO NOT USE (was: OCaml general)public2014-06-04 10:062015-12-11 19:28
Assigned Tofrisch 
PlatformOSOS Version
Product Version4.02.0+beta1 / +rc1 
Target VersionFixed in Version4.02.0+dev 
Summary0006451: does not correctly untype ASTs.
Descriptiontools/ exists but not quite useful since it does not untype typed AST correctly. The results are often not compilable nor too different from the original.

This is not only the incompleteness of but also due to the compiler bugs. So far I found:

* Pwith_modsubst's lid is misused for other id's longident in
* Some structure items and class fields are listed in the reversed order in the typed AST.

The compiler changes the parsed AST during the type-checking, therefore it is natural that we cannot have 100% identical untyped AST from the source code. But at least it should be more compatible and compilable.
Attached Files

- Relationships

-  Notes
furuse (reporter)
2014-06-04 10:14

I have a patch to fix this issue (to some extent). With this patch I could build a bootstrapped compiler with the following paths:

   source => parsing => typing => untype with => typing again => code gen

This never proves the correctness of the fixed, but it is better than something which produces non-compilable.

I will post the patch as a pull request at [^] later.
furuse (reporter)
2014-06-04 18:26

Hi, a pull request is now available at [^]
gasche (developer)
2014-06-04 22:05

I think untypeast may become important for 4.02 -ppx users, so we should considering bugfixing this in the release branch as well. I haven't looked at the patch yet so I cannot comment on its "safeness", but those type of roundtrip tests tend to be higly effective to improve correctness, so I would be rather confident.
frisch (developer)
2014-06-05 21:37

Committed to 4.02 (rev 14956).

- Issue History
Date Modified Username Field Change
2014-06-04 10:06 furuse New Issue
2014-06-04 10:14 furuse Note Added: 0011650
2014-06-04 18:26 furuse Note Added: 0011654
2014-06-04 21:06 doligez Tag Attached: patch
2014-06-04 22:05 gasche Note Added: 0011661
2014-06-05 21:37 frisch Note Added: 0011688
2014-06-05 21:37 frisch Status new => resolved
2014-06-05 21:37 frisch Resolution open => fixed
2014-06-05 21:37 frisch Assigned To => frisch
2014-06-05 21:38 frisch Fixed in Version => 4.02.0+dev
2015-12-11 19:28 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker