File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed
testsuite/tests/typing-local Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -2630,3 +2630,33 @@ Error: This local value escapes its region
2630
2630
Hint : This is a partial application
2631
2631
Adding 1 more argument will make the value non - local
2632
2632
|}]
2633
+
2634
+ (* Reported internal to Jane Street as COMPILERS-1504 *)
2635
+
2636
+ module M : sig
2637
+ val f : string -> string -> local_ string
2638
+ end = struct
2639
+ let g x y = local_ " foo"
2640
+ let f x = local_ g x
2641
+ end ;;
2642
+ [%% expect{|
2643
+ Lines 3-6 , characters 6-3 :
2644
+ 3 | ......struct
2645
+ 4 | let g x y = local_ " foo"
2646
+ 5 | let f x = local_ g x
2647
+ 6 | end ..
2648
+ Error : Signature mismatch :
2649
+ Modules do not match :
2650
+ sig
2651
+ val g : 'a -> 'b -> local_ string
2652
+ val f : 'a -> local_ ('b -> local_ string )
2653
+ end
2654
+ is not included in
2655
+ sig val f : string -> string -> local_ string end
2656
+ Values do not match :
2657
+ val f : 'a -> local_ ('b -> local_ string )
2658
+ is not included in
2659
+ val f : string -> string -> local_ string
2660
+ The type string -> local_ (string -> local_ string )
2661
+ is not compatible with the type string -> string -> local_ string
2662
+ |}]
Original file line number Diff line number Diff line change @@ -337,12 +337,11 @@ and print_out_arg am ppf ty =
337
337
and print_out_ret mode rm ppf ty =
338
338
match mode, rm with
339
339
| Oam_local , Oam_local
340
- | Oam_global , Oam_global
341
- | Oam_unknown , _
342
- | _ , Oam_unknown -> print_out_type_1 rm ppf ty
340
+ | Oam_global , Oam_global -> print_out_type_1 rm ppf ty
343
341
| _ , Oam_local ->
344
342
print_out_type_local rm ppf ty
345
343
| _ , Oam_global -> print_out_type_2 rm ppf ty
344
+ | _ , Oam_unknown -> print_out_type_1 rm ppf ty
346
345
347
346
and print_out_type_local m ppf ty =
348
347
if Language_extension. is_enabled Local then begin
You can’t perform that action at this time.
0 commit comments