diff --git a/src/dune_rules/dune_file.ml b/src/dune_rules/dune_file.ml index eedee8836e8..098fdb035c7 100644 --- a/src/dune_rules/dune_file.ml +++ b/src/dune_rules/dune_file.ml @@ -539,20 +539,11 @@ module Library = struct else (* Old behavior: if old parser succeeds, return that. Otherwise, if parsing the ordered set language succeeds, ask the user to upgrade to - a supported version. Otherwise, fail with the first error. *) - try_ - (Mode_conf.Lib.Set.decode >>| fun modes -> `Modes modes) - (fun exn -> - try_ - ( Mode_conf.Lib.Set.decode_osl ~stanza_loc project >>| fun modes -> - if dune_version >= expected_version then `Modes modes - else `Upgrade ) - (fun _ -> raise exn)) - >>| function - | `Modes modes -> modes - | `Upgrade -> - Syntax.Error.since stanza_loc Stanza.syntax expected_version - ~what:"Ordered set language for modes" + a supported version *) + try_ Mode_conf.Lib.Set.decode (fun _exn -> + Mode_conf.Lib.Set.decode_osl ~stanza_loc project >>| fun _modes -> + Syntax.Error.since stanza_loc Stanza.syntax expected_version + ~what:"Ordered set language for modes") end type visibility =