summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-gadts
diff options
context:
space:
mode:
authorAntal Spector-Zabusky <antal.b.sz@gmail.com>2021-05-12 11:58:10 -0400
committerAntal Spector-Zabusky <antal.b.sz@gmail.com>2021-06-21 14:43:35 -0400
commit1820e785a540e08d2e293e36740a7654e29bf772 (patch)
treea160ee8ebb2205721ce6e641cb54b02c8b5556a8 /testsuite/tests/typing-gadts
parent2abe3e4d3d0339d9d8a6d61afd9167d5fabcb3cc (diff)
downloadocaml-1820e785a540e08d2e293e36740a7654e29bf772.tar.gz
Respond to review for the new structured error messages (#10407)
In addition to the smaller fixes, there were two major changes: 1. `Errortrace` has its type completely refactored, removing `desc` and exposing both `'variant trace` and `'variant error`. The former is for traces that are being built up, and contains `type_expr`s; the lattern is for complete traces, and contains `expanded_type`s (a record containing two `type_expr`s). This dramatically affected a number of call sites, but is much cleaner. 2. We now detect weakly polymorphic types much better during printing. This involved fixing a bug in moregeneral, which was not restoring enough information in the error case; it also involved exposing the flag that differentiated between printing a type (no weakly polymorphic type detection) and a scheme (yes weakly polymorphic type detection) in more places, and giving it its own custom variant type, `Printtyp.type_or_scheme`. Among the minor changes, the updates to `Includecore` to more carefully detect privacy violation errors and differentiate between the various kinds thereof (recorded in the `privacy_mismatch` type) is the most visible in the code.
Diffstat (limited to 'testsuite/tests/typing-gadts')
-rw-r--r--testsuite/tests/typing-gadts/ambiguity.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/testsuite/tests/typing-gadts/ambiguity.ml b/testsuite/tests/typing-gadts/ambiguity.ml
index 7f023f845a..2c0d5a4631 100644
--- a/testsuite/tests/typing-gadts/ambiguity.ml
+++ b/testsuite/tests/typing-gadts/ambiguity.ml
@@ -233,8 +233,9 @@ Error: Signature mismatch:
val r : '_weak1 list ref
is not included in
val r : T.u list ref
- The type 'weak1 list ref is not compatible with the type T.u list ref
- This instance of T.u is ambiguous:
+ The type '_weak1 list ref is not compatible with the type T.u list ref
+ Type '_weak1 is not compatible with type T.u = T.t
+ This instance of T.t is ambiguous:
it would escape the scope of its equation
|}]
@@ -267,7 +268,8 @@ Error: Signature mismatch:
val r : '_weak2 list ref
is not included in
val r : T.t list ref
- The type 'weak2 list ref is not compatible with the type T.t list ref
- This instance of T.t is ambiguous:
+ The type '_weak2 list ref is not compatible with the type T.t list ref
+ Type '_weak2 is not compatible with type T.t = T.u
+ This instance of T.u is ambiguous:
it would escape the scope of its equation
|}]