فهرست منبع

move make_static_call to typecore.ml

Simon Krajewski 11 سال پیش
والد
کامیت
885305be48
2فایلهای تغییر یافته به همراه9 افزوده شده و 6 حذف شده
  1. 1 6
      codegen.ml
  2. 8 0
      typecore.ml

+ 1 - 6
codegen.ml

@@ -673,12 +673,7 @@ module Abstract = struct
 				maybe_recurse (apply_params a.a_types pl a.a_this)
 
 	let make_static_call ctx c cf a pl args t p =
-		let ta = TAnon { a_fields = c.cl_statics; a_status = ref (Statics c) } in
-		let ethis = mk (TTypeExpr (TClassDecl c)) ta p in
-	  	let monos = List.map (fun _ -> mk_mono()) cf.cf_params in
-		let map t = apply_params a.a_types pl (apply_params cf.cf_params monos t) in
-		let ef = mk (TField (ethis,(FStatic (c,cf)))) (map cf.cf_type) p in
-		make_call ctx ef args (map t) p
+		make_static_call ctx c cf (apply_params a.a_types pl) args t p
 
 	let rec do_check_cast ctx tleft eright p =
 		let tright = follow eright.etype in

+ 8 - 0
typecore.ml

@@ -273,6 +273,14 @@ let unify_min ctx el = (!unify_min_ref) ctx el
 
 let match_expr ctx e cases def with_type p = !match_expr_ref ctx e cases def with_type p
 
+let make_static_call ctx c cf map args t p =
+	let ta = TAnon { a_fields = c.cl_statics; a_status = ref (Statics c) } in
+	let ethis = mk (TTypeExpr (TClassDecl c)) ta p in
+	let monos = List.map (fun _ -> mk_mono()) cf.cf_params in
+	let map t = map (apply_params cf.cf_params monos t) in
+	let ef = mk (TField (ethis,(FStatic (c,cf)))) (map cf.cf_type) p in
+	make_call ctx ef args (map t) p
+
 let unify ctx t1 t2 p =
 	try
 		Type.unify t1 t2