Skip to content
Success

Changes

Summary

  1. functor error messages: don't forget equality (details)
Commit 8b1e26db2d9067c62680a0607e9f2f1255f93bde by Florian Angeletti
functor error messages: don't forget equality

Higher-level error messages for functors recompute inclusion checks when
trying to discover more macro-level error messages. For this
reconstruction to be accurate, those computations must use the same
environment than the one used when detecting the original problem.

In particular, this environment must include equalities added during the
pairing of types and modules during the signature inclusion test. For
instance, in

    module M: sig
       type t
       module F(X:sig val f:t val g:int end): sig end
    end = struct
      type t
      module F(X:sig val f:t val g:float end)= struct end
    end

we must remember that the interface-side `t` is equal to the
implementation-side `t`.

This part of the inclusion checking environment was ignored before this
commit leading to non-sensical error messages complaining that `t` is
not compatible with `t`.

This commit extends the captured environment for errors in signature to
include the substitution recording the equalities between items on both
side of the check.
The file was modified.depend (diff)
The file was modifiedtestsuite/tests/typing-modules/functors.ml (diff)
The file was modifiedChanges (diff)
The file was modifiedtyping/includemod_errorprinter.ml (diff)
The file was modifiedtyping/includemod.ml (diff)
The file was modifiedtyping/includemod.mli (diff)