Skip to content

Commit 62db54f

Browse files
committed
flambda-backend: Fix freshening substitutions
1 parent 57231d2 commit 62db54f

File tree

7 files changed

+91
-141
lines changed

7 files changed

+91
-141
lines changed

boot/ocamlc

-865 Bytes
Binary file not shown.

boot/ocamllex

0 Bytes
Binary file not shown.

testsuite/tests/basic/patmatch_for_multiple.ml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ match (3, 2, 1) with
1212
;;
1313
[%%expect{|
1414
(let
15-
(*match*/88 = 3
16-
*match*/89 = 2
17-
*match*/90 = 1
18-
*match*/91 = *match*/88
19-
*match*/92 = *match*/89
20-
*match*/93 = *match*/90)
15+
(*match*/268 = 3
16+
*match*/269 = 2
17+
*match*/270 = 1
18+
*match*/271 = *match*/268
19+
*match*/272 = *match*/269
20+
*match*/273 = *match*/270)
2121
(catch
2222
(catch
23-
(catch (if (!= *match*/92 3) (exit 3) (exit 1)) with (3)
24-
(if (!= *match*/91 1) (exit 2) (exit 1)))
23+
(catch (if (!= *match*/272 3) (exit 3) (exit 1)) with (3)
24+
(if (!= *match*/271 1) (exit 2) (exit 1)))
2525
with (2) 0)
2626
with (1) 1))
2727
- : bool = false
@@ -36,24 +36,25 @@ match (3, 2, 1) with
3636
;;
3737
[%%expect{|
3838
(let
39-
(*match*/96 = 3
40-
*match*/97 = 2
41-
*match*/98 = 1
42-
*match*/99 = (makeblock 0 *match*/96 *match*/97 *match*/98))
39+
(*match*/276 = 3
40+
*match*/277 = 2
41+
*match*/278 = 1
42+
*match*/279 = (makeblock 0 *match*/276 *match*/277 *match*/278))
4343
(catch
4444
(catch
45-
(let (*match*/100 =a (field 0 *match*/99))
45+
(let (*match*/280 =a (field 0 *match*/279))
4646
(catch
47-
(let (*match*/101 =a (field 1 *match*/99))
48-
(if (!= *match*/101 3) (exit 7)
49-
(let (*match*/102 =a (field 2 *match*/99)) (exit 5 *match*/99))))
47+
(let (*match*/281 =a (field 1 *match*/279))
48+
(if (!= *match*/281 3) (exit 7)
49+
(let (*match*/282 =a (field 2 *match*/279))
50+
(exit 5 *match*/279))))
5051
with (7)
51-
(if (!= *match*/100 1) (exit 6)
52+
(if (!= *match*/280 1) (exit 6)
5253
(let
53-
(*match*/104 =a (field 2 *match*/99)
54-
*match*/103 =a (field 1 *match*/99))
55-
(exit 5 *match*/99)))))
54+
(*match*/284 =a (field 2 *match*/279)
55+
*match*/283 =a (field 1 *match*/279))
56+
(exit 5 *match*/279)))))
5657
with (6) 0)
57-
with (5 x/94[0: [int], [int], [int]]) (seq (ignore x/94) 1)))
58+
with (5 x/274[0: [int], [int], [int]]) (seq (ignore x/274) 1)))
5859
- : bool = false
5960
|}];;

testsuite/tests/generalized-open/gpr1506.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ include struct open struct type t = T end let x = T end
103103
Line 1, characters 15-41:
104104
1 | include struct open struct type t = T end let x = T end
105105
^^^^^^^^^^^^^^^^^^^^^^^^^^
106-
Error: The type t/150 introduced by this open appears in the signature
106+
Error: The type t/330 introduced by this open appears in the signature
107107
Line 1, characters 46-47:
108-
The value x has no valid type if t/150 is hidden
108+
The value x has no valid type if t/330 is hidden
109109
|}];;
110110

111111
module A = struct
@@ -123,9 +123,9 @@ Lines 3-6, characters 4-7:
123123
4 | type t = T
124124
5 | let x = T
125125
6 | end
126-
Error: The type t/155 introduced by this open appears in the signature
126+
Error: The type t/335 introduced by this open appears in the signature
127127
Line 7, characters 8-9:
128-
The value y has no valid type if t/155 is hidden
128+
The value y has no valid type if t/335 is hidden
129129
|}];;
130130

131131
module A = struct
@@ -142,9 +142,9 @@ Lines 3-5, characters 4-7:
142142
3 | ....open struct
143143
4 | type t = T
144144
5 | end
145-
Error: The type t/160 introduced by this open appears in the signature
145+
Error: The type t/340 introduced by this open appears in the signature
146146
Line 6, characters 8-9:
147-
The value y has no valid type if t/160 is hidden
147+
The value y has no valid type if t/340 is hidden
148148
|}]
149149

150150
(* It was decided to not allow this anymore. *)

testsuite/tests/typing-gadts/principality-and-gadts.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ val foo : int foo -> int = <fun>
362362
Line 3, characters 26-31:
363363
3 | | { x = (x : int); eq = Refl3 } -> x
364364
^^^^^
365-
Warning 18 [not-principal]: typing this pattern requires considering M.t and int as equal.
365+
Warning 18 [not-principal]: typing this pattern requires considering M.t and N.t as equal.
366366
But the knowledge of these types is not principal.
367367
val foo : int foo -> int = <fun>
368368
|}]

testsuite/tests/typing-sigsubst/sigsubst.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ end
2424
Line 3, characters 2-36:
2525
3 | include Comparable with type t = t
2626
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27-
Error: Illegal shadowing of included type t/98 by t/102
27+
Error: Illegal shadowing of included type t/278 by t/282
2828
Line 2, characters 2-19:
29-
Type t/98 came from this include
29+
Type t/278 came from this include
3030
Line 3, characters 2-23:
31-
The value print has no valid type if t/98 is shadowed
31+
The value print has no valid type if t/278 is shadowed
3232
|}]
3333

3434
module type Sunderscore = sig

0 commit comments

Comments
 (0)