|
@@ -848,7 +848,7 @@ let add_field_inits ctx t =
|
|
eassign;
|
|
eassign;
|
|
) inits in
|
|
) inits in
|
|
let el = if !need_this then (mk (TVar((v, Some ethis))) ethis.etype ethis.epos) :: el else el in
|
|
let el = if !need_this then (mk (TVar((v, Some ethis))) ethis.etype ethis.epos) :: el else el in
|
|
- match c.cl_constructor with
|
|
|
|
|
|
+ let cf = match c.cl_constructor with
|
|
| None ->
|
|
| None ->
|
|
let ct = TFun([],ctx.com.basic.tvoid) in
|
|
let ct = TFun([],ctx.com.basic.tvoid) in
|
|
let ce = mk (TFunction {
|
|
let ce = mk (TFunction {
|
|
@@ -858,15 +858,19 @@ let add_field_inits ctx t =
|
|
}) ct c.cl_pos in
|
|
}) ct c.cl_pos in
|
|
let ctor = mk_field "new" ct c.cl_pos in
|
|
let ctor = mk_field "new" ct c.cl_pos in
|
|
ctor.cf_kind <- Method MethNormal;
|
|
ctor.cf_kind <- Method MethNormal;
|
|
- c.cl_constructor <- Some { ctor with cf_expr = Some ce };
|
|
|
|
|
|
+ { ctor with cf_expr = Some ce }
|
|
| Some cf ->
|
|
| Some cf ->
|
|
match cf.cf_expr with
|
|
match cf.cf_expr with
|
|
| Some { eexpr = TFunction f } ->
|
|
| Some { eexpr = TFunction f } ->
|
|
let bl = match f.tf_expr with {eexpr = TBlock b } -> b | x -> [x] in
|
|
let bl = match f.tf_expr with {eexpr = TBlock b } -> b | x -> [x] in
|
|
let ce = mk (TFunction {f with tf_expr = mk (TBlock (el @ bl)) ctx.com.basic.tvoid c.cl_pos }) cf.cf_type cf.cf_pos in
|
|
let ce = mk (TFunction {f with tf_expr = mk (TBlock (el @ bl)) ctx.com.basic.tvoid c.cl_pos }) cf.cf_type cf.cf_pos in
|
|
- c.cl_constructor <- Some {cf with cf_expr = Some ce }
|
|
|
|
|
|
+ {cf with cf_expr = Some ce };
|
|
| _ ->
|
|
| _ ->
|
|
assert false
|
|
assert false
|
|
|
|
+ in
|
|
|
|
+ let config = Analyzer.Config.get_base_config ctx.com false in
|
|
|
|
+ Analyzer.Run.run_on_field ctx config c cf;
|
|
|
|
+ c.cl_constructor <- Some cf
|
|
in
|
|
in
|
|
match t with
|
|
match t with
|
|
| TClassDecl c ->
|
|
| TClassDecl c ->
|