Skip to content

Commit

Permalink
Fixed bugs with 'and' and class types
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Feb 4, 2013
1 parent 9fbcb56 commit d7ded5d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 93 deletions.
5 changes: 3 additions & 2 deletions src/indentBlock.ml
Expand Up @@ -581,7 +581,7 @@ let rec update_path config t stream tok =

| TYPE ->
(match last_token t with
| Some MODULE -> t.path (* module type *)
| Some (MODULE | CLASS) -> t.path (* module type *)
| Some (WITH|AND) -> append KType L t.path
| _ -> append KType L (unwind_top t.path))

Expand Down Expand Up @@ -757,7 +757,8 @@ let rec update_path config t stream tok =
t.path
in
(match path with
| {k=KModule|KLet|KLetIn|KExternal} :: _ ->
| {k = KModule|KLet|KLetIn|KExternal
| KAnd(KModule|KLet|KLetIn|KExternal)} :: _ ->
append KColon L path
| {k=KVal} as h :: p ->
let indent = config.i_base in
Expand Down
8 changes: 4 additions & 4 deletions tests/failing-output/unit-classes.ml
Expand Up @@ -9,7 +9,7 @@ class type c =
end

class type c =
M.cl
M.cl

class type c =
['a, 'b] M.cl
Expand Down Expand Up @@ -81,9 +81,9 @@ class cl =
and
virtual ['a, 'b]
cl2 x y :
object
val x : bool
end = fun x y ->
object
val x : bool
end = fun x y ->
object
val x : bool = true
end
Expand Down
80 changes: 0 additions & 80 deletions tests/failing-output/unit-modtypes.ml

This file was deleted.

6 changes: 3 additions & 3 deletions tests/failing/unit-classes.ml
Expand Up @@ -81,9 +81,9 @@ class cl =
and
virtual ['a, 'b]
cl2 x y :
object
val x : bool
end = fun x y ->
object
val x : bool
end = fun x y ->
object
val x : bool = true
end
Expand Down
Expand Up @@ -54,11 +54,11 @@ sig
end

class type clt =
object
end
object
end
and ['a] clt2 =
object
end
object
end

module M :
Sig
Expand Down

0 comments on commit d7ded5d

Please sign in to comment.