Browse Source

fix python conflicts with get_shortname (for very long class names)

frabbit 10 years ago
parent
commit
507bb72e73
1 changed files with 2 additions and 3 deletions
  1. 2 3
      codegen.ml

+ 2 - 3
codegen.ml

@@ -295,7 +295,7 @@ let get_short_name =
 	let i = ref (-1) in
 	let i = ref (-1) in
 	(fun () ->
 	(fun () ->
 		incr i;
 		incr i;
-		Printf.sprintf "__hx_type_%i" !i
+		Printf.sprintf "Hx___short___hx_type_%i" !i
 	)
 	)
 
 
 let rec build_generic ctx c p tl =
 let rec build_generic ctx c p tl =
@@ -461,8 +461,7 @@ let rec build_generic ctx c p tl =
 		(* In rare cases the class name can become too long, so let's shorten it (issue #3090). *)
 		(* In rare cases the class name can become too long, so let's shorten it (issue #3090). *)
 		if String.length (snd cg.cl_path) > 254 then begin
 		if String.length (snd cg.cl_path) > 254 then begin
 			let n = get_short_name () in
 			let n = get_short_name () in
-			let tp = fst cg.cl_path,n in
-			cg.cl_meta <- (Meta.Native,[EConst(String (s_type_path tp)),p],p) :: cg.cl_meta;
+			cg.cl_meta <- (Meta.Native,[EConst(String (n)),p],p) :: cg.cl_meta;
 		end;
 		end;
 		TInst (cg,[])
 		TInst (cg,[])
 	end
 	end