浏览代码

[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
 
 and decode_tparam_decl v =
+	let vconstraints = field v "constraints" in
 	{
 		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
 			| [t] -> Some (decode_ctype t)
 			| tl -> Some (CTIntersection (List.map decode_ctype tl),Globals.null_pos)