diff --git a/src/module.ml b/src/module.ml index c7d26694..2ef21c34 100644 --- a/src/module.ml +++ b/src/module.ml @@ -166,11 +166,16 @@ let to_sexp { name; impl; intf; obj_name ; pp } = let deprecate t = { t with - intf = None - ; impl = + impl = Some ( - let impl = Option.value_exn t.impl in - let (base, _) = Path.split_extension impl.path in + let path = + match t.intf, t.impl with + | Some _, Some impl + | None, Some impl -> impl.path + | Some intf, _ -> intf.path + | None, None -> assert false + in + let (base, _) = Path.split_extension path in { syntax = OCaml ; path = Path.extend_basename base ~suffix:".ml-gen" } diff --git a/test/blackbox-tests/test-cases/wrapped-transition/fooexe.ml b/test/blackbox-tests/test-cases/wrapped-transition/fooexe.ml index 05f52bc8..7ea5bdc1 100644 --- a/test/blackbox-tests/test-cases/wrapped-transition/fooexe.ml +++ b/test/blackbox-tests/test-cases/wrapped-transition/fooexe.ml @@ -2,3 +2,6 @@ Mylib.Bar.run ();; Mylib.Foo.run ();; Bar.run ();; Foo.run ();; + +module Y : Mylib.Intf_only.S = struct end +module X : Intf_only.S = struct end diff --git a/test/blackbox-tests/test-cases/wrapped-transition/lib/dune b/test/blackbox-tests/test-cases/wrapped-transition/lib/dune index 29516cc2..8cd2dab1 100644 --- a/test/blackbox-tests/test-cases/wrapped-transition/lib/dune +++ b/test/blackbox-tests/test-cases/wrapped-transition/lib/dune @@ -1,3 +1,4 @@ (library (name mylib) + (modules_without_implementation intf_only) (wrapped (transition "Will be removed past 2020-20-20"))) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/wrapped-transition/lib/intf_only.mli b/test/blackbox-tests/test-cases/wrapped-transition/lib/intf_only.mli new file mode 100644 index 00000000..d63d6c08 --- /dev/null +++ b/test/blackbox-tests/test-cases/wrapped-transition/lib/intf_only.mli @@ -0,0 +1 @@ +module type S = sig end