Fix deprecation attribute for transition modules

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-08-29 13:14:51 +03:00
parent 492286ba12
commit f9ad608e8c
2 changed files with 9 additions and 8 deletions

View File

@ -137,8 +137,8 @@ module Gen (P : Install_rules.Params) = struct
let name = Module.Name.to_string name in
let hidden_name = sprintf "%s__%s" lib_name name in
let real_name = sprintf "%s.%s" lib_name name in
sprintf "include %s [@@deprecated \"%s. Use %s instead.\"]"
hidden_name transition_message real_name
sprintf {|[@@@deprecated "%s. Use %s instead."] include %s|}
transition_message real_name hidden_name
in
let source_path = Option.value_exn (Module.file m Impl) in
Build.return contents

View File

@ -1,6 +1,7 @@
$ dune build
fooexe alias default
bar
foo
bar
foo
$ dune build 2>&1 | grep -v ocamlc
File "fooexe.ml", line 3, characters 0-7:
Error (warning 3): deprecated: module Bar
Will be removed past 2020-20-20. Use Mylib.Bar instead.
File "fooexe.ml", line 4, characters 0-7:
Error (warning 3): deprecated: module Foo
Will be removed past 2020-20-20. Use Mylib.Foo instead.