diff --git a/src/dir_contents.ml b/src/dir_contents.ml index 8ff4d515..77645dbf 100644 --- a/src/dir_contents.ml +++ b/src/dir_contents.ml @@ -121,6 +121,11 @@ end = struct in let uncapitalized = List.map ~f:(fun (_, m) -> Module.name m |> Module.Name.uncapitalize) in + let line_list modules = + List.map ~f:(fun (_, m) -> + Module.name m |> Module.Name.to_string |> sprintf "- %s") modules + |> String.concat ~sep:"\n" + in begin match virt_intf_overlaps with | [] -> () | (loc, _) :: _ -> @@ -128,11 +133,7 @@ end = struct "These modules appear in the virtual_libraries \ and modules_without_implementation fields: \ \n%s\nThis is not possible." - (virt_intf_overlaps - |> uncapitalized - |> List.map ~f:(sprintf "- %s") - |> String.concat ~sep:"\n" - ) + (line_list virt_intf_overlaps) end; if missing_intf_only <> [] then begin match Ordered_set_lang.loc buildable.modules_without_implementation with @@ -153,17 +154,12 @@ end = struct in Dsexp.to_string ~syntax:Dune (List (tag :: modules))) | Some loc -> - let list_modules l = - uncapitalized l - |> List.map ~f:(sprintf "- %s") - |> String.concat ~sep:"\n" - in Errors.warn loc "The following modules must be listed here as they don't \ have an implementation:\n\ %s\n\ This will become an error in the future." - (list_modules missing_intf_only) + (line_list missing_intf_only) end; begin match missing_modules with | [] -> () diff --git a/test/blackbox-tests/test-cases/intf-only/run.t b/test/blackbox-tests/test-cases/intf-only/run.t index 7005a0e4..c022680d 100644 --- a/test/blackbox-tests/test-cases/intf-only/run.t +++ b/test/blackbox-tests/test-cases/intf-only/run.t @@ -40,7 +40,7 @@ Errors: 3 | (modules_without_implementation x)) ^ Warning: The following modules must be listed here as they don't have an implementation: - - y + - Y This will become an error in the future. ocamlc .foo.objs/foo.{cmi,cmo,cmt} ocamlc foo.cma diff --git a/test/blackbox-tests/test-cases/variants/run.t b/test/blackbox-tests/test-cases/variants/run.t index 4df2a7ec..d191063e 100644 --- a/test/blackbox-tests/test-cases/variants/run.t +++ b/test/blackbox-tests/test-cases/variants/run.t @@ -42,7 +42,7 @@ virtual libraries may not implement their virtual modules 4 | (virtual_modules m)) ^ Error: These modules appear in the virtual_libraries and modules_without_implementation fields: - - m + - M This is not possible. ------------------------- impl: false. modules_without_implementation: true. virtual_modules: false