Skip to content

Commit

Permalink
fix Null-wrapping in add_final_return (closes HaxeFoundation#4341)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Jun 18, 2015
1 parent 3a1d544 commit 4a3ca9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filters.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ let rec add_final_return e =
| TAbstract ({ a_path = [],"Bool" },_) -> TBool false
| _ -> TNull
) in
{ eexpr = TReturn (Some { eexpr = TConst c; epos = p; etype = t }); etype = t; epos = p }
{ eexpr = TReturn (Some { eexpr = TConst c; epos = p; etype = t }); etype = t_dynamic; epos = p }
in
match e.eexpr with
| TBlock el ->
Expand All @@ -169,7 +169,7 @@ let rec add_final_return e =
| TFunction f ->
let f = (match follow f.tf_type with
| TAbstract ({ a_path = [],"Void" },[]) -> f
| t -> { f with tf_expr = loop f.tf_expr t }
| _ -> { f with tf_expr = loop f.tf_expr f.tf_type }
) in
{ e with eexpr = TFunction f }
| _ -> e
Expand Down

0 comments on commit 4a3ca9a

Please sign in to comment.