浏览代码

fixed broken overloads

Nicolas Cannasse 13 年之前
父节点
当前提交
0252dc0cbe
共有 1 个文件被更改,包括 8 次插入1 次删除
  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,_) ->
 		let el , t, e = (match follow e.etype with
 		| 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
 			el,(match tfunc with TFun(_,r) -> r | _ -> assert false), {e with etype = tfunc}
 		| TMono _ ->