2
0
Dan Korostelev 7 жил өмнө
parent
commit
2d1e3f0e88

+ 12 - 1
src/codegen/gencommon/castDetect.ml

@@ -582,8 +582,19 @@ let select_overload gen applied_f overloads types params =
 	| (t,cf) :: _ -> cf,t,false
 	| _ -> assert false
 
+let rec cur_ctor c tl =
+	match c.cl_constructor with
+	| Some ctor ->
+		ctor, c, tl
+	| None ->
+		match c.cl_super with
+		| None ->
+			raise Not_found
+		| Some (sup,stl) ->
+			cur_ctor sup (List.map (apply_params c.cl_params tl) stl)
+
 let choose_ctor gen cl tparams etl maybe_empty_t p =
-	let ctor, sup, stl = OverloadingConstructor.cur_ctor cl tparams in
+	let ctor, sup, stl = cur_ctor cl tparams in
 	(* get returned stl, with Dynamic as t_empty *)
 	let rec get_changed_stl c tl =
 		if c == sup then

+ 0 - 10
src/codegen/gencommon/overloadingConstructor.ml

@@ -41,16 +41,6 @@ open Gencommon
 		empty construction without the need of incompatibility with the platform's native construction method
 		the ability to call super() constructor in any place in the constructor
 *)
-let rec cur_ctor c tl =
-	match c.cl_constructor with
-	| Some ctor ->
-		ctor, c, tl
-	| None ->
-		match c.cl_super with
-		| None ->
-			raise Not_found
-		| Some (sup,stl) ->
-			cur_ctor sup (List.map (apply_params c.cl_params tl) stl)
 
 let rec prev_ctor c tl =
 	match c.cl_super with