|
@@ -1998,9 +1998,13 @@ let generate_class ctx c =
|
|
|
let acc = (match v.v_read with
|
|
|
| AccCall n when n <> "get_" ^ f.cf_name ->
|
|
|
(* generate get_xxx method *)
|
|
|
- let fk = begin_fun ctx [] f.cf_type [ethis] false p in
|
|
|
- gen_expr ctx false (mk (TReturn (Some (mk (TCall (mk (TField (ethis,n)) t_dynamic p,[])) f.cf_type p))) t_dynamic p);
|
|
|
- let m = fk() in
|
|
|
+ let m = if c.cl_interface then
|
|
|
+ end_fun ctx [] None f.cf_type
|
|
|
+ else
|
|
|
+ let fk = begin_fun ctx [] f.cf_type [ethis] false p in
|
|
|
+ gen_expr ctx false (mk (TReturn (Some (mk (TCall (mk (TField (ethis,n)) t_dynamic p,[])) f.cf_type p))) t_dynamic p);
|
|
|
+ fk()
|
|
|
+ in
|
|
|
{
|
|
|
hlf_name = ident ("get_" ^ f.cf_name);
|
|
|
hlf_slot = alloc_slot();
|
|
@@ -2019,9 +2023,13 @@ let generate_class ctx c =
|
|
|
| AccCall n when n <> "set_" ^ f.cf_name ->
|
|
|
(* generatee set_xxx method *)
|
|
|
let v = alloc_var "tmp" f.cf_type in
|
|
|
- let fk = begin_fun ctx [v,None] f.cf_type [ethis] false p in
|
|
|
- gen_expr ctx false (mk (TReturn (Some (mk (TCall (mk (TField (ethis,n)) t_dynamic p,[mk (TLocal v) v.v_type p])) f.cf_type p))) t_dynamic p);
|
|
|
- let m = fk() in
|
|
|
+ let m = if c.cl_interface then
|
|
|
+ end_fun ctx [v,None] None f.cf_type
|
|
|
+ else
|
|
|
+ let fk = begin_fun ctx [v,None] f.cf_type [ethis] false p in
|
|
|
+ gen_expr ctx false (mk (TReturn (Some (mk (TCall (mk (TField (ethis,n)) t_dynamic p,[mk (TLocal v) v.v_type p])) f.cf_type p))) t_dynamic p);
|
|
|
+ fk()
|
|
|
+ in
|
|
|
{
|
|
|
hlf_name = ident ("set_" ^ f.cf_name);
|
|
|
hlf_slot = alloc_slot();
|