-
Notifications
You must be signed in to change notification settings - Fork 469
Alert floating attributes in mli are ignored #6820
Copy link
Copy link
Closed as not planned
Description
Reproduction
With the following files:
$ cat dune
(executable
(name bar)
(flags (-alert +all))
(modules foo bar))
$ cat dune-project
(lang dune 2.7)
$ cat bar.ml
let () = print_endline Foo.x
$ cat foo.ml
let x = "Hello"
$ cat foo.mli
[@@@alert unsafe "Reason: it's not safe."]
val x : string
Run dune build.
Expected Behavior
dune build should exit 0 (or 1 if alerts are fatal) with an error message as we can observe with the following command line:
$ ocamlc -c -alert +all foo.mli foo.ml bar.ml
File "bar.ml", line 1, characters 23-28:
1 | let () = print_endline Foo.x
^^^^^
Alert unsafe: module Foo
Reason: it's not safe.
Actual Behavior
dune build exits 0 without printing anything.
Specifications
- Version of
dune(output ofdune --version): 3.6.1 - Version of
ocaml(output ofocamlc --version): 4.14.0 - Operating system (distribution and version): Ubuntu 22.04.1 LTS
Additional information
If the attribute is attached to the val x declaration, it works correctly. A workaround would be to remove the floating attribute and add an item attribute for each declaration.
Same problem with deprecated or ocaml.deprecated attributes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels