Przeglądaj źródła

fixed recursive typedef

Nicolas Cannasse 18 lat temu
rodzic
commit
28d4e60ceb
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      typer.ml

+ 1 - 0
typer.ml

@@ -2571,6 +2571,7 @@ let type_module ctx m tdecls loadp =
 			let t = get_tdef d.d_name in
 			ctx.type_params <- t.t_types;
 			let tt = load_type ctx p d.d_data in
+			if t.t_type == follow tt then error "Recursive typedef is not allowed" p;
 			(match t.t_type with
 			| TMono r ->
 				(match !r with