|Anonymous | Login | Signup for a new account||2015-11-27 05:41 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006451||OCaml||OCaml general||public||2014-06-04 10:06||2014-06-05 21:38|
|Product Version||4.02.0+beta1 / +rc1|
|Target Version||Fixed in Version||4.02.0+dev|
|Summary||0006451: untypeast.ml does not correctly untype ASTs.|
|Description||tools/untypeast.ml 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 untypeast.ml but also due to the compiler bugs. So far I found:
* Pwith_modsubst's lid is misused for other id's longident in typemod.ml.
* 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.
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 untypeast.ml => typing again => code gen
This never proves the correctness of the fixed untypeast.ml, but it is better than something which produces non-compilable.
I will post the patch as a pull request at https://github.com/ocaml/ocaml [^] later.
|Hi, a pull request is now available at https://github.com/ocaml/ocaml/pull/70 [^]|
|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.|
|Committed to 4.02 (rev 14956).|
|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|
|Copyright © 2000 - 2011 MantisBT Group|