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
ocaml.ppwarning ignored in the toplevel #7081
Comments
Comment author: @sliquister Presumably Typemod.type_toplevel_phrase should call Typetexp.emit_external_warnings.structure, like Typemod.type_implementation and Typemod.type_interface do. |
Comment author: @diml Thinking more about this, using an AST mapper here is not perfect as you can't disable the warning with [@@@ocaml.warning "-22"]. |
Comment author: @alainfrisch
Indeed, and here is what the comment in the code says: let emit_external_warnings = (* Note: this is run as a preliminary pass when type-checking an interface or implementation. This allows to cover all kinds of attributes, but the drawback is that it doesn't take local configuration of warnings (with '@@warning'/'@@warnerror' attributes) into account. We should rather check for 'ppwarning' attributes during the actual type-checking, making sure to cover all contexts (easier and more ugly alternative: duplicate here the logic which control warnings locally). *) ... |
Original bug ID: 7081
Reporter: @sliquister
Assigned to: @diml
Status: closed (set by @xavierleroy on 2017-02-16T14:18:16Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Bug description
The toplevel ignores [@ocaml.ppwarning ".."], which is quite confusing.
Steps to reproduce
$ cat /tmp/a.ml
1 [@ppwarning "asd"];;
$ ocaml /tmp/a.ml
$ ocamlc /tmp/a.ml
File "/tmp/a.ml", line 1, characters 14-19:
Warning 22: asd
The text was updated successfully, but these errors were encountered: