Skip to content

Commit 5e74455

Browse files
Fix issue #2729 (#2735)
* add test showcasing issue * fix issue * promote test
1 parent 5efba0c commit 5e74455

File tree

10 files changed

+53
-1
lines changed

10 files changed

+53
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Warning: labeled_tuples.ml:634 exceeds the margin
2+
Warning: labeled_tuples.ml:635 exceeds the margin

test/passing/refs.ahrefs/labeled_tuples.ml.ref

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,3 +629,11 @@ let
629629
(* after y *),
630630
(* bz *)
631631
~z:(*zv*) 0 (*end*) )
632+
633+
module type T = sig
634+
val x :
635+
from:ttttttttttttttttttttttttttttttttt * ttttttttttttttttttttttttttttttttttt ->
636+
tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ->
637+
a ->
638+
'b
639+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
Warning: labeled_tuples.ml:200 exceeds the margin
2+
Warning: labeled_tuples.ml:573 exceeds the margin
3+
Warning: labeled_tuples.ml:574 exceeds the margin

test/passing/refs.default/labeled_tuples.ml.ref

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,3 +568,11 @@ let
568568
(* after y *),
569569
(* bz *)
570570
~z:(*zv*) 0 (*end*) )
571+
572+
module type T = sig
573+
val x :
574+
from:ttttttttttttttttttttttttttttttttt * ttttttttttttttttttttttttttttttttttt ->
575+
tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt ->
576+
a ->
577+
'b
578+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Warning: labeled_tuples.ml:634 exceeds the margin

test/passing/refs.janestreet/labeled_tuples.ml.ref

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,3 +628,11 @@ let
628628
, (* bz *)
629629
~z:(*zv*) 0 (*end*) )
630630
;;
631+
632+
module type T = sig
633+
val x
634+
: from:ttttttttttttttttttttttttttttttttt * ttttttttttttttttttttttttttttttttttt
635+
-> tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
636+
-> a
637+
-> 'b
638+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Warning: labeled_tuples.ml:223 exceeds the margin
2+
Warning: labeled_tuples.ml:641 exceeds the margin

test/passing/refs.ocamlformat/labeled_tuples.ml.ref

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,3 +634,12 @@ let
634634
(* after y *)
635635
, (* bz *)
636636
~z:(*zv*) 0 (*end*) )
637+
638+
module type T = sig
639+
val x :
640+
from:
641+
ttttttttttttttttttttttttttttttttt * ttttttttttttttttttttttttttttttttttt
642+
-> tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
643+
-> a
644+
-> 'b
645+
end

test/passing/tests/labeled_tuples.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,3 +657,11 @@ let (*before*) ~(x (*l-ty*):int (*after-ty*)) (*after x*),
657657
(*before y*) ~y (* after y *), (* bz *) ~z:(*zv*)0 (*end*) =
658658
(*before*) ~(x (*l-ty*):int (*after-ty*)) (*after x*),
659659
(*before y*) ~y (* after y *), (* bz *)~z:(*zv*)0 (*end*)
660+
661+
module type T = sig
662+
val x
663+
: from:ttttttttttttttttttttttttttttttttt * ttttttttttttttttttttttttttttttttttt
664+
-> tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
665+
-> a
666+
-> 'b
667+
end

vendor/parser-extended/parser.mly

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,12 @@ function_type:
36273627
pap_type = domain;
36283628
}
36293629
in
3630-
Ptyp_arrow([arrow_type], codomain) }
3630+
let params, codomain =
3631+
match codomain.ptyp_attributes, codomain.ptyp_desc with
3632+
| [], Ptyp_arrow (params, codomain) -> params, codomain
3633+
| _, _ -> [], codomain
3634+
in
3635+
Ptyp_arrow(arrow_type :: params, codomain) }
36313636
)
36323637
{ $1 }
36333638
| label = LIDENT COLON proper_tuple_type %prec MINUSGREATER

0 commit comments

Comments
 (0)