From 048765bc580bd7473c9f87605259bf5871bdb9c0 Mon Sep 17 00:00:00 2001 From: Florian Angeletti Date: Mon, 13 Mar 2023 14:32:16 +0100 Subject: error messages: aliases for weakly polymorphic row variables --- .../pr6899_second_bad.compilers.reference | 2 +- testsuite/tests/typing-objects/Exemples.ml | 2 +- testsuite/tests/typing-objects/Tests.ml | 2 +- testsuite/tests/typing-objects/dummy.ml | 2 +- testsuite/tests/typing-objects/errors.ml | 2 +- testsuite/tests/typing-polyvariants-bugs/pr10664a.ml | 2 +- testsuite/tests/typing-polyvariants-bugs/pr7817_bad.ml | 13 ++++++++----- 7 files changed, 14 insertions(+), 11 deletions(-) (limited to 'testsuite') diff --git a/testsuite/tests/typing-modules-bugs/pr6899_second_bad.compilers.reference b/testsuite/tests/typing-modules-bugs/pr6899_second_bad.compilers.reference index 66950a172c..7646edba86 100644 --- a/testsuite/tests/typing-modules-bugs/pr6899_second_bad.compilers.reference +++ b/testsuite/tests/typing-modules-bugs/pr6899_second_bad.compilers.reference @@ -1,5 +1,5 @@ File "pr6899_second_bad.ml", line 12, characters 6-9: 12 | let bar = wrap () ^^^ -Error: The type of this expression, _[< `Test ] -> unit, +Error: The type of this expression, ([< `Test ] as '_weak1) -> unit, contains type variables that cannot be generalized diff --git a/testsuite/tests/typing-objects/Exemples.ml b/testsuite/tests/typing-objects/Exemples.ml index 067b8f8f0b..3ab4072c14 100644 --- a/testsuite/tests/typing-objects/Exemples.ml +++ b/testsuite/tests/typing-objects/Exemples.ml @@ -517,7 +517,7 @@ class ['a] sorted_list : let l = new sorted_list ();; [%%expect{| -val l : _#comparable sorted_list = +val l : (#comparable as '_weak1) sorted_list = |}];; let c = new int_comparable 10;; [%%expect{| diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml index cc7ae24aad..5ca2804f44 100644 --- a/testsuite/tests/typing-objects/Tests.ml +++ b/testsuite/tests/typing-objects/Tests.ml @@ -950,7 +950,7 @@ end;; Line 2, characters 13-58: 2 | method o = object(_ : 'self) method o = assert false end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Error: Cannot close type of object literal: < o : '_weak3; _.. > +Error: Cannot close type of object literal: < o : '_weak4; .. > as '_weak3 it has been unified with the self type of a class that is not yet completely defined. |}];; diff --git a/testsuite/tests/typing-objects/dummy.ml b/testsuite/tests/typing-objects/dummy.ml index f2b797d25b..de8b18822a 100644 --- a/testsuite/tests/typing-objects/dummy.ml +++ b/testsuite/tests/typing-objects/dummy.ml @@ -169,7 +169,7 @@ Lines 4-10, characters 4-7: 9 | method child = assert false 10 | end Error: Cannot close type of object literal: - < child : '_weak1; previous : 'a option; _.. > as 'a + < child : '_weak2; previous : '_weak1 option; .. > as '_weak1 it has been unified with the self type of a class that is not yet completely defined. |}] diff --git a/testsuite/tests/typing-objects/errors.ml b/testsuite/tests/typing-objects/errors.ml index 7b13b58882..236f7e1d5b 100644 --- a/testsuite/tests/typing-objects/errors.ml +++ b/testsuite/tests/typing-objects/errors.ml @@ -9,7 +9,7 @@ Line 1, characters 0-75: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: The type of this class, class virtual ['a] c : - object constraint 'a = _[< `A of int & float ] end, + object constraint '_a = [< `A of int & float ] as '_weak1 end, contains non-collapsible conjunctive types in constraints. Type int is not compatible with type float |}] diff --git a/testsuite/tests/typing-polyvariants-bugs/pr10664a.ml b/testsuite/tests/typing-polyvariants-bugs/pr10664a.ml index 27ab01f00c..7993e10a40 100644 --- a/testsuite/tests/typing-polyvariants-bugs/pr10664a.ml +++ b/testsuite/tests/typing-polyvariants-bugs/pr10664a.ml @@ -110,7 +110,7 @@ let y = g o;; [%%expect{| val o : < m : 'a 'c. < n : ([< `A of 'a ] as 'c) -> 'b > > as 'b = val y : - < n : _[< `A of '_weak2 ] -> + < n : ([< `A of '_weak3 ] as '_weak2) -> (< m : 'a 'c. < n : ([< `A of 'a ] as 'c) -> 'b > > as 'b) > = |}] diff --git a/testsuite/tests/typing-polyvariants-bugs/pr7817_bad.ml b/testsuite/tests/typing-polyvariants-bugs/pr7817_bad.ml index fc9cf7fbda..999420fd2b 100644 --- a/testsuite/tests/typing-polyvariants-bugs/pr7817_bad.ml +++ b/testsuite/tests/typing-polyvariants-bugs/pr7817_bad.ml @@ -19,15 +19,18 @@ Lines 5-8, characters 6-3: 8 | end Error: Signature mismatch: Modules do not match: - sig val write : _[< `A of '_weak2 | `B of '_weak3 ] -> unit end + sig + val write : + ([< `A of '_weak3 | `B of '_weak4 ] as '_weak2) -> unit + end is not included in sig val write : [< `A of string | `B of int ] -> unit end Values do not match: - val write : _[< `A of '_weak2 | `B of '_weak3 ] -> unit + val write : ([< `A of '_weak3 | `B of '_weak4 ] as '_weak2) -> unit is not included in val write : [< `A of string | `B of int ] -> unit - The type _[< `A of '_weak2 | `B of '_weak3 ] -> unit + The type ([< `A of '_weak3 | `B of '_weak4 ] as '_weak2) -> unit is not compatible with the type [< `A of string | `B of int ] -> unit - Type _[< `A of '_weak2 | `B of '_weak3 ] is not compatible with type - [< `A of string | `B of int ] + Type [< `A of '_weak3 | `B of '_weak4 ] as '_weak2 + is not compatible with type [< `A of string | `B of int ] |}] -- cgit v1.2.1