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
combining -i and -annot #5538
Comments
Comment author: @gasche I have a related request: I recently noticed that |
Comment author: @alainfrisch In addition to performing type-checking, "-i" also prints the inferred interface. Maybe we should introduce a new "type-check only" flag, which does the full type-checking (and produce .annot files if requested), without printing the interface. |
Comment author: @xavierleroy Several OCaml developers are discussing this PR right now, and we're not sure what usage scenario you have in mind. Why is it that you can't use "ocamlc -c -annot" ? |
Comment author: @garrigue I just stumbled on it when trying to look both at the interface generated for a unit and its annotations. |
Comment author: @gasche I believe the expected behavior is rather clear: don't ignore any explicitly passed flag, even in presence of -i.
If there was an additional typecheck-only flag as suggested by Alain, it would be implied by -i and -annot, but would not imply interface printing -- a reasonable rationale for this is that interface printing can be slow. |
Comment author: @xavierleroy I am not questioning the expected behavior: I'm questioning the need for yet another flag or combination of flags, given that "ocamlc -i" followed by "ocamlc -c -dannot" does the job in this case. In the past, -i was a modifier on -c and would not prevent generation of compiled files, and some users made a reasonable point that -i should print the inferred interface and do nothing else. Could we just stick with this behavior? |
Comment author: @damiendoligez I have looked into the code and noticed that "ocamlopt" does allow -i and -annot together. I have brought ocamlc in line with ocamlopt on all these points. Until the next release, you can work around this issue by using "ocamlopt -i -annot". Fixed in 4.00 (commit 12284) and trunk (commit 12285). |
Original bug ID: 5538
Reporter: @garrigue
Status: closed (set by @damiendoligez on 2012-03-27T15:11:36Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.13.0+dev
Fixed in version: 4.00.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche @hcarty
Bug description
Currently ocamlc -i disables any output to files.
It would be nice that combining -i and -annot would still generate the .annot file,
so that one get all the typing information without actually compiling.
The text was updated successfully, but these errors were encountered: