浏览代码

translate :: operator into haxe.ds.ImmutableList.prepend

Nicolas Cannasse 7 年之前
父节点
当前提交
3d8fa06a57
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/typing/typer.ml

+ 3 - 0
src/typing/typer.ml

@@ -1858,6 +1858,9 @@ let rec type_binop ctx op e1 e2 is_assign_op with_type p =
 			| _ ->
 			| _ ->
 				Value
 				Value
 		in
 		in
+		if wt = Value && op = OpList then
+			type_expr ctx (ECall ((EField ((EField ((EField ((EConst (Ident "haxe"),p),"ds"),p),"ImmutableList"),p),"prepend"),p),[e1;e2]),p) Value
+		else
 		let e1 = type_expr ctx e1 wt in
 		let e1 = type_expr ctx e1 wt in
 		type_binop2 ctx op e1 e2 is_assign_op wt p
 		type_binop2 ctx op e1 e2 is_assign_op wt p