Browse Source

unify abstract implementation functions while inlining

Simon Krajewski 12 years ago
parent
commit
aa15bc0e04
1 changed files with 3 additions and 2 deletions
  1. 3 2
      optimizer.ml

+ 3 - 2
optimizer.ml

@@ -395,8 +395,9 @@ let rec type_inline ctx cf f ethis params tret config p force =
 			(match follow ethis.etype with
 			(match follow ethis.etype with
 			| TAnon a -> (match !(a.a_status) with
 			| TAnon a -> (match !(a.a_status) with
 				| Statics {cl_kind = KAbstractImpl a } when Meta.has Meta.Impl cf.cf_meta ->
 				| Statics {cl_kind = KAbstractImpl a } when Meta.has Meta.Impl cf.cf_meta ->
-					(* TODO: we might have to unify something here *)
-					()
+					(* the first argument must unify with a_this for abstract implementation functions *)
+					let tb = (TFun(("",false,map_type a.a_this) :: List.map (fun e -> "",false,e.etype) (List.tl params),tret)) in
+					unify_raise ctx mt tb p
 				| _ -> unify_func())
 				| _ -> unify_func())
 			| _ -> unify_func());
 			| _ -> unify_func());
 			(*
 			(*