فهرست منبع

fixed recursive typedef

Nicolas Cannasse 18 سال پیش
والد
کامیت
28d4e60ceb
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  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
 			let t = get_tdef d.d_name in
 			ctx.type_params <- t.t_types;
 			ctx.type_params <- t.t_types;
 			let tt = load_type ctx p d.d_data in
 			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
 			(match t.t_type with
 			| TMono r ->
 			| TMono r ->
 				(match !r with
 				(match !r with