|
@@ -1768,13 +1768,19 @@ let init_class ctx c p context_init herits fields =
|
|
if not (left_eq || right_eq) then error ("The left or right argument type must be " ^ (s_type (print_context()) targ)) f.cff_pos;
|
|
if not (left_eq || right_eq) then error ("The left or right argument type must be " ^ (s_type (print_context()) targ)) f.cff_pos;
|
|
if right_eq && Meta.has Meta.Commutative f.cff_meta then error ("@:commutative is only allowed if the right argument is not " ^ (s_type (print_context()) targ)) f.cff_pos;
|
|
if right_eq && Meta.has Meta.Commutative f.cff_meta then error ("@:commutative is only allowed if the right argument is not " ^ (s_type (print_context()) targ)) f.cff_pos;
|
|
a.a_ops <- (op,cf) :: a.a_ops;
|
|
a.a_ops <- (op,cf) :: a.a_ops;
|
|
- if fd.f_expr = None then do_bind := false;
|
|
|
|
|
|
+ if fd.f_expr = None then begin
|
|
|
|
+ if inline then error ("Inline operator functions must have an expression") f.cff_pos;
|
|
|
|
+ do_bind := false
|
|
|
|
+ end;
|
|
| (Meta.Op,[EUnop(op,flag,_),_],_) :: _ ->
|
|
| (Meta.Op,[EUnop(op,flag,_),_],_) :: _ ->
|
|
if is_macro then error "Macro operator functions are not supported" p;
|
|
if is_macro then error "Macro operator functions are not supported" p;
|
|
let targ = if Meta.has Meta.Impl f.cff_meta then tthis else ta in
|
|
let targ = if Meta.has Meta.Impl f.cff_meta then tthis else ta in
|
|
(try type_eq EqStrict t (tfun [targ] (mk_mono())) with Unify_error l -> raise (Error ((Unify l),f.cff_pos)));
|
|
(try type_eq EqStrict t (tfun [targ] (mk_mono())) with Unify_error l -> raise (Error ((Unify l),f.cff_pos)));
|
|
a.a_unops <- (op,flag,cf) :: a.a_unops;
|
|
a.a_unops <- (op,flag,cf) :: a.a_unops;
|
|
- if fd.f_expr = None then do_bind := false;
|
|
|
|
|
|
+ if fd.f_expr = None then begin
|
|
|
|
+ if inline then error ("Inline operator functions must have an expression") f.cff_pos;
|
|
|
|
+ do_bind := false
|
|
|
|
+ end;
|
|
| _ :: ml ->
|
|
| _ :: ml ->
|
|
loop ml
|
|
loop ml
|
|
| [] ->
|
|
| [] ->
|