Skip to content

Commit

Permalink
add __init__ as a fake field in DCE so it is recognized as entry po…
Browse files Browse the repository at this point in the history
…int (see HaxeFoundation#3286)
  • Loading branch information
Simn committed Sep 3, 2014
1 parent 4327275 commit fe683e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dce.ml
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,16 @@ let run com main full =
begin match c.cl_constructor with
| Some cf -> loop false cf
| None -> ()
end
end;
begin match c.cl_init with
| Some e when keep_class || Meta.has Meta.KeepInit c.cl_meta ->
(* create a fake field to deal with our internal logic (issue #3286) *)
let cf = mk_field "__init__" e.etype e.epos in
cf.cf_expr <- Some e;
loop true cf
| _ ->
()
end;
| TEnumDecl en when keep_whole_enum dce en ->
mark_enum dce en
| _ ->
Expand Down

0 comments on commit fe683e5

Please sign in to comment.