浏览代码

disallow unop access on abstracts unless they explicitly define it (closes #1938)

Simon Krajewski 12 年之前
父节点
当前提交
28ed468aee
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -1826,7 +1826,7 @@ and type_unop ctx op flag e p =
 							if type_iseq (tfun [e.etype] m) tcf then cf,tcf,m else loop opl
 					| _ :: opl -> loop opl
 				in
-				let cf,t,r = loop a.a_unops in
+				let cf,t,r = try loop a.a_unops with Not_found -> error "Invalid operation" p in
 				if not (can_access ctx c cf true) then error ("Cannot access " ^ cf.cf_name) p;
 				(match cf.cf_expr with
 				| None ->