Browse Source

commented

Nicolas Cannasse 13 years ago
parent
commit
55c13d45ad
1 changed files with 4 additions and 0 deletions
  1. 4 0
      typer.ml

+ 4 - 0
typer.ml

@@ -577,6 +577,10 @@ let rec type_field ctx e i p mode =
 			loop_dyn c params
 			loop_dyn c params
 		with Not_found ->
 		with Not_found ->
 			if PMap.mem i c.cl_statics then error ("Cannot access static field " ^ i ^ " from a class instance") p;
 			if PMap.mem i c.cl_statics then error ("Cannot access static field " ^ i ^ " from a class instance") p;
+			(*
+				This is a fix to deal with optimize_completion which will call iterator()
+				on the expression for/in, which vectors do no have.
+			*)
 			if ctx.com.display && i = "iterator" && c.cl_path = (["flash"],"Vector") then begin
 			if ctx.com.display && i = "iterator" && c.cl_path = (["flash"],"Vector") then begin
 				let it = TAnon {
 				let it = TAnon {
 					a_fields = PMap.add "next" (mk_field "next" (TFun([],List.hd params)) p) PMap.empty;
 					a_fields = PMap.add "next" (mk_field "next" (TFun([],List.hd params)) p) PMap.empty;