Nicolas Cannasse %!s(int64=15) %!d(string=hai) anos
pai
achega
8448e38694
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      genneko.ml

+ 4 - 1
genneko.ml

@@ -837,5 +837,8 @@ let generate com libs =
 	if command ("nekoc \"" ^ neko_file ^ "\"") <> 0 then failwith "Neko compilation failure";
 	c();
 	let output = Filename.chop_extension neko_file ^ ".n" in
-	if output <> com.file then Sys.rename output com.file;
+	if output <> com.file then begin
+		(try Sys.remove com.file with _ -> ());
+		Sys.rename output com.file;
+	end;
 	if not source then Sys.remove neko_file