Browse Source

use Class<T>, Enum<T> and Abstract<T> instead of #T (closes #2526)

Simon Krajewski 11 years ago
parent
commit
2a6ebe2da2
3 changed files with 4 additions and 4 deletions
  1. 1 1
      type.ml
  2. 1 1
      typeload.ml
  3. 2 2
      typer.ml

+ 1 - 1
type.ml

@@ -457,7 +457,7 @@ let rec s_type ctx t =
 			(if b then "?" else "") ^ (if s = "" then "" else s ^ " : ") ^ s_fun ctx t true
 			(if b then "?" else "") ^ (if s = "" then "" else s ^ " : ") ^ s_fun ctx t true
 		) l) ^ " -> " ^ s_fun ctx t false
 		) l) ^ " -> " ^ s_fun ctx t false
 	| TAnon a ->
 	| TAnon a ->
-	let fl = PMap.fold (fun f acc -> ((if Meta.has Meta.Optional f.cf_meta then " ?" else " ") ^ f.cf_name ^ " : " ^ s_type ctx f.cf_type) :: acc) a.a_fields [] in
+		let fl = PMap.fold (fun f acc -> ((if Meta.has Meta.Optional f.cf_meta then " ?" else " ") ^ f.cf_name ^ " : " ^ s_type ctx f.cf_type) :: acc) a.a_fields [] in
 		"{" ^ (if not (is_closed a) then "+" else "") ^  String.concat "," fl ^ " }"
 		"{" ^ (if not (is_closed a) then "+" else "") ^  String.concat "," fl ^ " }"
 	| TDynamic t2 ->
 	| TDynamic t2 ->
 		"Dynamic" ^ s_type_params ctx (if t == t2 then [] else [t2])
 		"Dynamic" ^ s_type_params ctx (if t == t2 then [] else [t2])

+ 1 - 1
typeload.ml

@@ -77,7 +77,7 @@ let make_module ctx mpath file tdecls loadp =
 				e_constrs = PMap.empty;
 				e_constrs = PMap.empty;
 				e_names = [];
 				e_names = [];
 				e_type = {
 				e_type = {
-					t_path = fst path, "#" ^ snd path;
+					t_path = fst path, "Enum<" ^ (snd path) ^ ">";
 					t_module = m;
 					t_module = m;
 					t_doc = None;
 					t_doc = None;
 					t_pos = p;
 					t_pos = p;

+ 2 - 2
typer.ml

@@ -646,7 +646,7 @@ let rec type_module_type ctx t tparams p =
 	match t with
 	match t with
 	| TClassDecl c ->
 	| TClassDecl c ->
 		let t_tmp = {
 		let t_tmp = {
-			t_path = fst c.cl_path, "#" ^ snd c.cl_path;
+			t_path = fst c.cl_path, "Class<" ^ (snd c.cl_path) ^ ">" ;
 			t_module = c.cl_module;
 			t_module = c.cl_module;
 			t_doc = None;
 			t_doc = None;
 			t_pos = c.cl_pos;
 			t_pos = c.cl_pos;
@@ -678,7 +678,7 @@ let rec type_module_type ctx t tparams p =
 	| TAbstractDecl a ->
 	| TAbstractDecl a ->
 		if not (Meta.has Meta.RuntimeValue a.a_meta) then error (s_type_path a.a_path ^ " is not a value") p;
 		if not (Meta.has Meta.RuntimeValue a.a_meta) then error (s_type_path a.a_path ^ " is not a value") p;
 		let t_tmp = {
 		let t_tmp = {
-			t_path = fst a.a_path, "#" ^ snd a.a_path;
+			t_path = fst a.a_path, "Abstract<" ^ (snd a.a_path) ^ ">";
 			t_module = a.a_module;
 			t_module = a.a_module;
 			t_doc = None;
 			t_doc = None;
 			t_pos = a.a_pos;
 			t_pos = a.a_pos;