Browse Source

Merge pull request #2077 from Herschel/commutative-op-fix

ABSTRACTS: Fix @:commutative on ops without a body
Simon Krajewski 12 years ago
parent
commit
e0c13382f9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -1791,8 +1791,8 @@ let rec type_binop ctx op e1 e2 is_assign_op p =
 			let f,r,assign,commutative = find_overload a pl c e1.etype false in
 			begin match f.cf_expr with
 				| None ->
-					let e1 = match follow e1.etype with TAbstract(a,pl) -> {e1 with etype = apply_params a.a_types pl a.a_this} | _ -> e1 in
 					let e1,e2 = if commutative then e2,e1 else e1,e2 in
+					let e1 = match follow e1.etype with TAbstract(a,pl) -> {e1 with etype = apply_params a.a_types pl a.a_this} | _ -> e1 in
 					cast_rec e1 {e2 with etype = apply_params a.a_types pl a.a_this} r
 				| Some _ ->
 					let e1,e2 = if commutative then e2,e1 else e1,e2 in