Permalink
Browse files

Fix pretty printing of types

Use type_scheme instead of type_expr, use generic level for printing.
  • Loading branch information...
let-def committed Mar 1, 2013
1 parent e2bfa1a commit f574600933ab68abde72697e12e56923388e4dab
Showing with 4 additions and 4 deletions.
  1. +1 −1 TODO
  2. +3 −3 command.ml
View
2 TODO
@@ -6,6 +6,7 @@ DONE List modules on load path, even not loaded ones
DONE Configure script: check for packages
DONE Traverse parse tree to find node nearest to a given location
DONE Editor integration : allow to retrieve definition boundary to improve synchronisation
+DONE Fix pretty printing of type variables
WIP Rework handling of errors and warnings: generalize use of "catch" pattern
WIP (in type-error branch) Hack typer: give type (forall a. a) to unbound values and ill-typed expressions
- Write documentation:
@@ -14,7 +15,6 @@ WIP (in type-error branch) Hack typer: give type (forall a. a) to unbound values
- EMACS mode ?
- Internal design
- Move path management to a dedicated module
-- Fix pretty printing of type variables
- Pretty(ugly)-print hacked parse-trees for debugging purposes
to extract as much information as possible.
- Use inotify to detect cmi changes.
View
@@ -202,7 +202,7 @@ let command_type = {
let ppf, to_string = Misc.ppf_to_string () in
begin match t with
| Browse.Envs.Other -> raise Not_found
- | Browse.Envs.Expr e -> Printtyp.type_expr ppf e
+ | Browse.Envs.Expr e -> Printtyp.type_scheme ppf e
| Browse.Envs.Type t -> Printtyp.type_declaration (Ident.create "_") ppf t
| Browse.Envs.Module m -> Printtyp.modtype ppf m
| Browse.Envs.Modtype m -> Printtyp.modtype_declaration (Ident.create "_") ppf m
@@ -217,7 +217,7 @@ let command_type = {
let aux = function
| Browse.Envs.T (loc,_,Browse.Envs.Expr e,_) ->
let ppf, to_string = Misc.ppf_to_string () in
- Printtyp.type_expr ppf e;
+ Printtyp.type_scheme ppf e;
Some (Protocol.with_location loc ["type", `String (to_string ())])
| _ -> None
in
@@ -284,7 +284,7 @@ let complete_in_env env prefix =
in
Format.pp_print_string ppf name;
Format.pp_print_string ppf " : ";
- Printtyp.type_expr ppf { Types. level = 0 ; id = 0 ; desc } ;
+ Printtyp.type_scheme ppf (Btype.newgenty desc);
"Label"
| `Mod m ->
(if exact then

0 comments on commit f574600

Please sign in to comment.