|
@@ -2110,6 +2110,7 @@ and type_array_decl ctx el with_type p =
|
|
and type_array_comprehension ctx e with_type p =
|
|
and type_array_comprehension ctx e with_type p =
|
|
let v = gen_local ctx (mk_mono()) p in
|
|
let v = gen_local ctx (mk_mono()) p in
|
|
let et = ref (EConst(Ident "null"),p) in
|
|
let et = ref (EConst(Ident "null"),p) in
|
|
|
|
+ let comprehension_pos = p in
|
|
let rec map_compr (e,p) =
|
|
let rec map_compr (e,p) =
|
|
match e with
|
|
match e with
|
|
| EFor(it,e2) -> (EFor (it, map_compr e2),p)
|
|
| EFor(it,e2) -> (EFor (it, map_compr e2),p)
|
|
@@ -2122,10 +2123,10 @@ and type_array_comprehension ctx e with_type p =
|
|
end
|
|
end
|
|
| EParenthesis e2 -> (EParenthesis (map_compr e2),p)
|
|
| EParenthesis e2 -> (EParenthesis (map_compr e2),p)
|
|
| EBinop(OpArrow,a,b) ->
|
|
| EBinop(OpArrow,a,b) ->
|
|
- et := (ENew(({tpackage=["haxe";"ds"];tname="Map";tparams=[];tsub=None},null_pos),[]),p);
|
|
|
|
|
|
+ et := (ENew(({tpackage=["haxe";"ds"];tname="Map";tparams=[];tsub=None},null_pos),[]),comprehension_pos);
|
|
(ECall ((EField ((EConst (Ident v.v_name),p),"set"),p),[a;b]),p)
|
|
(ECall ((EField ((EConst (Ident v.v_name),p),"set"),p),[a;b]),p)
|
|
| _ ->
|
|
| _ ->
|
|
- et := (EArrayDecl [],p);
|
|
|
|
|
|
+ et := (EArrayDecl [],comprehension_pos);
|
|
(ECall ((EField ((EConst (Ident v.v_name),p),"push"),p),[(e,p)]),p)
|
|
(ECall ((EField ((EConst (Ident v.v_name),p),"push"),p),[(e,p)]),p)
|
|
in
|
|
in
|
|
let e = map_compr e in
|
|
let e = map_compr e in
|