Better error message for #745 (#748)

This commit is contained in:
Jérémie Dimino 2018-05-08 16:28:50 +01:00 committed by GitHub
parent f603fd6598
commit e6650a322f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -28,6 +28,9 @@ next
- Add support for setting the default ocaml flags and for build
profiles (#419, @diml)
- Display a better error messages when writing `(inline_tests)` in an
executable stanza (#748, @diml)
1.0+beta20 (10/04/2018)
-----------------------

View File

@ -890,6 +890,15 @@ module Executables = struct
field_oslu "link_flags" >>= fun link_flags ->
field "modes" Link_mode.Set.t ~default:Link_mode.Set.default
>>= fun modes ->
map_validate
(field "inline_tests" (fun _ -> true) ~default:false ~short:(This true))
~f:(function
| false -> Ok ()
| true ->
Error
"Inline tests are only allowed in libraries.\n\
See https://github.com/ocaml/dune/issues/745 for more details.")
>>= fun () ->
let t =
{ names
; link_executables