|
@@ -1575,7 +1575,8 @@ let rec type_binop ctx op e1 e2 is_assign_op p =
|
|
|
| [] -> raise Not_found
|
|
|
| (o,cf) :: ops when is_assign_op && o = OpAssignOp(op) || o == op ->
|
|
|
(match follow (monomorphs cf.cf_params cf.cf_type) with
|
|
|
- | TFun([(_,_,t1);(_,_,t2)],r) when (left || Meta.has Meta.Commutative cf.cf_meta) && type_iseq t t2 && can_access ctx c cf true ->
|
|
|
+ | TFun([(_,_,t1);(_,_,t2)],r) when (left || Meta.has Meta.Commutative cf.cf_meta) && type_iseq t t2 ->
|
|
|
+ if not (can_access ctx c cf true) then display_error ctx ("Cannot access operator function " ^ (s_type_path a.a_path) ^ "." ^ cf.cf_name) p;
|
|
|
cf,r,o = OpAssignOp(op)
|
|
|
| _ -> loop ops)
|
|
|
| _ :: ops ->
|