Guest User

Untitled

a guest
Feb 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. diff --git a/ocamlbuild/slurp.ml b/ocamlbuild/slurp.ml
  2. index d6c2846..fba88c3 100644
  3. --- a/ocamlbuild/slurp.ml
  4. +++ b/ocamlbuild/slurp.ml
  5. @@ -134,7 +134,7 @@ let slurp_with_find path =
  6. let lines =
  7. My_unix.run_and_open (Printf.sprintf "%s %s" find_cmd (Filename.quote path)) begin fun ic ->
  8. let acc = ref [] in
  9. - try while true do acc := input_line ic :: !acc done; []
  10. + try while true do acc := input_line ic :: !acc done
  11. with End_of_file -> !acc
  12. end in
  13. let res =
  14. diff --git a/typing/typecore.ml b/typing/typecore.ml
  15. index 61f4ea9..e517fab 100644
  16. --- a/typing/typecore.ml
  17. +++ b/typing/typecore.ml
  18. @@ -2216,11 +2216,18 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected =
  19. exp_env = env }
  20. | Pexp_while(scond, sbody) ->
  21. let cond = type_expect env scond Predef.type_bool in
  22. + let exp_type =
  23. + match cond.exp_desc with
  24. + | Texp_construct(_, {cstr_name="true"}, _) ->
  25. + instance env ty_expected
  26. + | _ ->
  27. + instance_def Predef.type_unit
  28. + in
  29. let body = type_statement env sbody in
  30. rue {
  31. exp_desc = Texp_while(cond, body);
  32. exp_loc = loc; exp_extra = [];
  33. - exp_type = instance_def Predef.type_unit;
  34. + exp_type;
  35. exp_attributes = sexp.pexp_attributes;
  36. exp_env = env }
  37. | Pexp_for(param, slow, shigh, dir, sbody) ->
Add Comment
Please, Sign In to add comment