|
@@ -940,6 +940,7 @@ let make_call ctx e params t p =
|
|
|
|
|
|
let mk_array_get_call ctx (cf,tf,r,e1,e2o) c ebase p = match cf.cf_expr with
|
|
|
| None ->
|
|
|
+ if not (Meta.has Meta.NoExpr cf.cf_meta) then display_error ctx "Recursive array get method" p;
|
|
|
mk (TArray(ebase,e1)) r p
|
|
|
| Some _ ->
|
|
|
let et = type_module_type ctx (TClassDecl c) None p in
|
|
@@ -950,6 +951,7 @@ let mk_array_set_call ctx (cf,tf,r,e1,e2o) c ebase p =
|
|
|
let evalue = match e2o with None -> assert false | Some e -> e in
|
|
|
match cf.cf_expr with
|
|
|
| None ->
|
|
|
+ if not (Meta.has Meta.NoExpr cf.cf_meta) then display_error ctx "Recursive array get method" p;
|
|
|
let ea = mk (TArray(ebase,e1)) r p in
|
|
|
mk (TBinop(OpAssign,ea,evalue)) r p
|
|
|
| Some _ ->
|
|
@@ -2160,6 +2162,7 @@ and type_binop2 ctx op (e1 : texpr) (e2 : Ast.expr) is_assign_op wt p =
|
|
|
let map = apply_params a.a_params tl in
|
|
|
let make op_cf cf e1 e2 tret =
|
|
|
if cf.cf_expr = None then begin
|
|
|
+ if not (Meta.has Meta.NoExpr cf.cf_meta) then display_error ctx "Recursive operator method" p;
|
|
|
if not (Meta.has Meta.CoreType a.a_meta) then begin
|
|
|
(* for non core-types we require that the return type is compatible to the native result type *)
|
|
|
let e' = make {e1 with etype = Abstract.follow_with_abstracts e1.etype} {e1 with etype = Abstract.follow_with_abstracts e2.etype} in
|