Browse Source

properly handle this assign without a block

Simon Krajewski 12 years ago
parent
commit
b2a789969c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      typeload.ml

+ 2 - 1
typeload.ml

@@ -134,7 +134,8 @@ let make_module ctx mpath file tdecls loadp =
 							fu with
 							f_expr = (match fu.f_expr with
 							| None -> None
-							| Some (EBlock [EBinop (OpAssign,(EConst (Ident "this"),_),e),_],_) -> Some (EReturn (Some e), pos e)
+							| Some (EBlock [EBinop (OpAssign,(EConst (Ident "this"),_),e),_],_ | EBinop (OpAssign,(EConst (Ident "this"),_),e),_) ->
+								Some (EReturn (Some e), pos e)
 							| Some (EBlock el,p) -> Some (EBlock (init p :: el @ [ret p]),p)
 							| Some e -> Some (EBlock [init p;e;ret p],p)
 							)