Browse Source

fixed broken overloads

Nicolas Cannasse 13 years ago
parent
commit
0252dc0cbe
1 changed files with 8 additions and 1 deletions
  1. 8 1
      typer.ml

+ 8 - 1
typer.ml

@@ -2247,7 +2247,14 @@ and build_call ctx acc el twith p =
 	| AKExpr e | AKField (e,_) ->
 	| AKExpr e | AKField (e,_) ->
 		let el , t, e = (match follow e.etype with
 		let el , t, e = (match follow e.etype with
 		| TFun (args,r) ->
 		| TFun (args,r) ->
-			let fopts = (match acc with AKField (e,f) -> (match follow e.etype with TInst (c,pl) -> Some (c,pl,f) | _ -> None) | _ -> None) in
+			let fopts = (match acc with 
+				| AKField (e,f) ->
+					(match e.eexpr with 
+					| TField (e,_) -> (match follow e.etype with TInst (c,pl) -> Some (c,pl,f) | TAnon a -> (match !(a.a_status) with Statics c -> Some (c,[],f) | _ -> None) | _ -> None) 
+					| _ -> None)
+				| _ ->
+					None
+			) in
 			let el, tfunc = unify_call_params ctx fopts el args r p false in
 			let el, tfunc = unify_call_params ctx fopts el args r p false in
 			el,(match tfunc with TFun(_,r) -> r | _ -> assert false), {e with etype = tfunc}
 			el,(match tfunc with TFun(_,r) -> r | _ -> assert false), {e with etype = tfunc}
 		| TMono _ ->
 		| TMono _ ->