diff --git a/CHANGES.md b/CHANGES.md index 7cba8e30..4def560c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,10 @@ unreleased - Fix failure of 'lift_map_with_context' in traverse by compile-time evaluation of 'fst' and 'snd' (#390, @smuenzel) +- Bias the mapping from magic to version towards the current version, + as it is usually the common case and it helps when magic numbers are + ambiguous (such as on development versions) (#409, @shym) + 0.29.1 (14/02/2023) ------------------ diff --git a/ast/versions.ml b/ast/versions.ml index 322981e4..69ebe18d 100644 --- a/ast/versions.ml +++ b/ast/versions.ml @@ -577,5 +577,10 @@ module Find_version = struct else loop tail in - loop all_versions + (* First check whether it could be the current version, probably + the most common use case. + This bias towards the current version also provides a way to + choose wisely between, say, `trunk` and the latest stable + release, for which the magic numbers are not distinguished *) + loop @@ ((module OCaml_current : OCaml_version) :: all_versions) end