소스 검색

[java/cs] Only return function overloads

Cauê Waneck 10 년 전
부모
커밋
23e5ade487
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      typeload.ml

+ 6 - 1
typeload.ml

@@ -812,7 +812,12 @@ let same_overload_args t1 t2 f1 f2 =
 let rec get_overloads c i =
 	let ret = try
 			let f = PMap.find i c.cl_fields in
-			(f.cf_type, f) :: (List.map (fun f -> f.cf_type, f) f.cf_overloads)
+			match f.cf_kind with
+				| Var _ ->
+					(* @:libType may generate classes that have a variable field in a superclass of an overloaded method *)
+					[]
+				| Method _ ->
+					(f.cf_type, f) :: (List.map (fun f -> f.cf_type, f) f.cf_overloads)
 		with | Not_found -> []
 	in
 	let rsup = match c.cl_super with