Browse Source

maintain position of capture variables when transforming to typed AST (closes #3675)

Simon Krajewski 10 years ago
parent
commit
4bbaf83e47
1 changed files with 2 additions and 2 deletions
  1. 2 2
      codegen.ml

+ 2 - 2
codegen.ml

@@ -909,9 +909,9 @@ module PatternMatchConversion = struct
 				if is_declared cctx v then
 				if is_declared cctx v then
 					vl, (mk (TBinop(OpAssign,mk (TLocal v) v.v_type p,e)) e.etype e.epos) :: el
 					vl, (mk (TBinop(OpAssign,mk (TLocal v) v.v_type p,e)) e.etype e.epos) :: el
 				else
 				else
-					((v,Some e) :: vl), el
+					((v,p,Some e) :: vl), el
 			) ([],[e]) bl in
 			) ([],[e]) bl in
-			let el_v = List.map (fun (v,eo) -> mk (TVar (v,eo)) cctx.ctx.t.tvoid e.epos) vl in
+			let el_v = List.map (fun (v,p,eo) -> mk (TVar (v,eo)) cctx.ctx.t.tvoid p) vl in
 			mk (TBlock (el_v @ el)) e.etype e.epos
 			mk (TBlock (el_v @ el)) e.etype e.epos
 		| DTGoto i ->
 		| DTGoto i ->
 			convert_dt cctx (cctx.dt_lookup.(i))
 			convert_dt cctx (cctx.dt_lookup.(i))