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.
Presumably Typemod.type_toplevel_phrase should call Typetexp.emit_external_warnings.structure, like Typemod.type_implementation and Typemod.type_interface do.
using an AST mapper here is not perfect as you can't disable the warning with [@@@ocaml.warning "-22"].
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: