ソースを参照

[eval] maybe fix constraints decoding

Simon Krajewski 7 年 前
コミット
4473041892
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/macro/macroApi.ml

+ 2 - 1
src/macro/macroApi.ml

@@ -680,9 +680,10 @@ and decode_tparams v =
 	decode_opt_array decode_tparam_decl v
 	decode_opt_array decode_tparam_decl v
 
 
 and decode_tparam_decl v =
 and decode_tparam_decl v =
+	let vconstraints = field v "constraints" in
 	{
 	{
 		tp_name = decode_placed_name (field v "name_pos") (field v "name");
 		tp_name = decode_placed_name (field v "name_pos") (field v "name");
-		tp_constraints = (match decode_array(field v "constraints") with
+		tp_constraints = if vconstraints = vnull then None else (match decode_array vconstraints with
 			| [] -> None
 			| [] -> None
 			| [t] -> Some (decode_ctype t)
 			| [t] -> Some (decode_ctype t)
 			| tl -> Some (CTIntersection (List.map decode_ctype tl),Globals.null_pos)
 			| tl -> Some (CTIntersection (List.map decode_ctype tl),Globals.null_pos)