File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
testsuite/tests/typing-local Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -2540,6 +2540,11 @@ type gfoo = GFoo of global_ string * string
2540
2540
type gfoo = GFoo of global_ string * string
2541
2541
|}]
2542
2542
2543
+ type gfoo' = GFoo ' : global_ string -> gfoo '
2544
+ [%% expect{|
2545
+ type gfoo' = GFoo ' : global_ string -> gfoo '
2546
+ |}]
2547
+
2543
2548
(* TESTING OF GLOBAL_ *)
2544
2549
2545
2550
(* global arguments must be global when constructing
Original file line number Diff line number Diff line change @@ -27,7 +27,13 @@ let transl_mode_annots modes =
27
27
match acc.linearity with
28
28
| None -> { acc with linearity = Some Linearity.Const. Once }
29
29
| Some _ -> raise (Error (loc, Duplicated_mode `Linearity )))
30
- | s -> Misc. fatal_errorf " Unrecognized mode %s - should not parse" s
30
+ | "global" ->
31
+ (* CR zqian: global modality might leak to here by ppxes.
32
+ This is a dirty fix that needs to be fixed ASAP. *)
33
+ acc
34
+ | s ->
35
+ Misc. fatal_errorf " Unrecognized mode %s at %a - should not parse" s
36
+ Location. print_loc loc
31
37
in
32
38
loop acc rest
33
39
in
@@ -45,8 +51,12 @@ let transl_global_flags gfs =
45
51
match acc with
46
52
| Unrestricted -> Global_flag. Global
47
53
| Global ->
48
- Misc. fatal_error " Duplicated global modality - should not parse" )
49
- | s -> Misc. fatal_errorf " Unrecognized modality %s - should not parse" s
54
+ Misc. fatal_errorf
55
+ " Duplicated global modality at %a - should not parse"
56
+ Location. print_loc loc)
57
+ | s ->
58
+ Misc. fatal_errorf " Unrecognized modality %s at %a - should not parse"
59
+ s Location. print_loc loc
50
60
in
51
61
loop acc rest
52
62
in
You can’t perform that action at this time.
0 commit comments