Browse Source

fixed dependency leak with global using

Nicolas Cannasse 11 years ago
parent
commit
5653ff5209
1 changed files with 7 additions and 1 deletions
  1. 7 1
      typer.ml

+ 7 - 1
typer.ml

@@ -1007,7 +1007,13 @@ let rec using_field ctx mode e i p =
 			loop l
 			loop l
 	in
 	in
 	try loop ctx.m.module_using with Not_found ->
 	try loop ctx.m.module_using with Not_found ->
-	try loop ctx.g.global_using with Not_found ->
+	try
+		let acc = loop ctx.g.global_using in
+		(match acc with
+		| AKUsing (_,c,_,_) -> add_dependency ctx.m.curmod c.cl_module
+		| _ -> assert false);
+		acc
+	with Not_found ->
 	if not !check_constant_struct then raise Not_found;
 	if not !check_constant_struct then raise Not_found;
 	remove_constant_flag e.etype (fun ok -> if ok then using_field ctx mode e i p else raise Not_found)
 	remove_constant_flag e.etype (fun ok -> if ok then using_field ctx mode e i p else raise Not_found)