Skip to content

Commit

Permalink
Fix regression on record field types
Browse files Browse the repository at this point in the history
Was caused by 03b441e, which should have been completely unrelated
  • Loading branch information
AltGr committed May 4, 2017
1 parent 4242c67 commit d3f250b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/indentBlock.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1291,8 +1291,8 @@ let rec update_path config block stream tok =
| Some ({kind=KExpr _} :: {kind=KType} :: ({kind=KColon} :: _ as p)) ->
(* let f: type t. t -> t = ... *)
p
| Some ({kind=KExpr 200} :: ({kind=KColon} :: _ as p)) ->
(* method m : 'x 'y . ... = *)
| Some ({kind=KExpr 200} :: ({kind=KColon} :: {kind=KLet} :: _ as p)) ->
(* method m : 'x 'y . ... = (KLet is actually "method") *)
p
| Some ({kind=KExpr i} :: ({kind=KBrace|KWith KBrace} as h :: p))
when (i = prio_max || i = prio_dot) && next_offset tok stream = None ->
Expand Down
6 changes: 3 additions & 3 deletions tests/failing-output/js-record.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type t =
type t =
{ a
: Something_lengthy.t list list
[@default String.Map.empty]
[@default String.Map.empty]
}

type t =
Expand All @@ -93,11 +93,11 @@ type t =
type t =
{ a
: Something_lengthy.t list
list
list
}

type t =
{ a
: Something_lengthy.t
list
list
}
10 changes: 5 additions & 5 deletions tests/failing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Failing tests, ocp-indent version 1.6.0+7 (2017-05-04)</title>
<title>Failing tests, ocp-indent version 1.6.0+8 (2017-05-04)</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style>
TABLE { border-collapse: collapse; border-spacing: 0px; margin: auto; }
Expand All @@ -17,7 +17,7 @@
</style>
</head>
<body>
<h1>Failing tests, ocp-indent version 1.6.0+7 (2017-05-04)</h1>
<h1>Failing tests, ocp-indent version 1.6.0+8 (2017-05-04)</h1>
<div>
<h2>Differences in edge-cases.ml</h2>
<table>
Expand Down Expand Up @@ -734,7 +734,7 @@ <h2>Differences in js-record.ml</h2>
<tr><td class="linenum">80</td><td class="correct"><pre>type t =</pre></td><td class="correct"><pre>type t =</pre></td></tr>
<tr><td class="linenum">81</td><td class="correct"><pre> { a</pre></td><td class="correct"><pre> { a</pre></td></tr>
<tr><td class="linenum">82</td><td class="correct"><pre> : Something_lengthy.t list list</pre></td><td class="correct"><pre> : Something_lengthy.t list list</pre></td></tr>
<tr><td class="linenum">83</td><td class="different"><pre>········[@default·String.Map.empty]</pre></td><td class="different"><pre>··························[@default·String.Map.empty]</pre></td></tr>
<tr><td class="linenum">83</td><td class="correct"><pre> [@default String.Map.empty]</pre></td><td class="correct"><pre> [@default String.Map.empty]</pre></td></tr>
<tr><td class="linenum">84</td><td class="correct"><pre> }</pre></td><td class="correct"><pre> }</pre></td></tr>
<tr><td class="linenum">85</td><td class="correct"><pre></pre></td><td class="correct"><pre></pre></td></tr>
<tr><td class="linenum">86</td><td class="correct"><pre>type t =</pre></td><td class="correct"><pre>type t =</pre></td></tr>
Expand All @@ -746,13 +746,13 @@ <h2>Differences in js-record.ml</h2>
<tr><td class="linenum">92</td><td class="correct"><pre>type t =</pre></td><td class="correct"><pre>type t =</pre></td></tr>
<tr><td class="linenum">93</td><td class="correct"><pre> { a</pre></td><td class="correct"><pre> { a</pre></td></tr>
<tr><td class="linenum">94</td><td class="correct"><pre> : Something_lengthy.t list</pre></td><td class="correct"><pre> : Something_lengthy.t list</pre></td></tr>
<tr><td class="linenum">95</td><td class="different"><pre>········list</pre></td><td class="different"><pre>··························list</pre></td></tr>
<tr><td class="linenum">95</td><td class="correct"><pre> list</pre></td><td class="correct"><pre> list</pre></td></tr>
<tr><td class="linenum">96</td><td class="correct"><pre> }</pre></td><td class="correct"><pre> }</pre></td></tr>
<tr><td class="linenum">97</td><td class="correct"><pre></pre></td><td class="correct"><pre></pre></td></tr>
<tr><td class="linenum">98</td><td class="correct"><pre>type t =</pre></td><td class="correct"><pre>type t =</pre></td></tr>
<tr><td class="linenum">99</td><td class="correct"><pre> { a</pre></td><td class="correct"><pre> { a</pre></td></tr>
<tr><td class="linenum">100</td><td class="correct"><pre> : Something_lengthy.t</pre></td><td class="correct"><pre> : Something_lengthy.t</pre></td></tr>
<tr><td class="linenum">101</td><td class="different"><pre>········list</pre></td><td class="different"><pre>··························list</pre></td></tr>
<tr><td class="linenum">101</td><td class="correct"><pre> list</pre></td><td class="correct"><pre> list</pre></td></tr>
<tr><td class="linenum">102</td><td class="correct"><pre> }</pre></td><td class="correct"><pre> }</pre></td></tr>
</table>
</div>
Expand Down

0 comments on commit d3f250b

Please sign in to comment.