Explorar el Código

prevent some Not_found from escaping from here

Nicolas Cannasse hace 7 años
padre
commit
a2058ad747
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/core/texpr.ml

+ 1 - 1
src/core/texpr.ml

@@ -335,7 +335,7 @@ let for_remap basic v e1 e2 p =
 	let v' = alloc_var v.v_name e1.etype e1.epos in
 	let ev' = mk (TLocal v') e1.etype e1.epos in
 	let t1 = (Abstract.follow_with_abstracts e1.etype) in
-	let ehasnext = mk (TField(ev',quick_field t1 "hasNext")) (tfun [] basic.tbool) e1.epos in
+	let ehasnext = mk (TField(ev',try quick_field t1 "hasNext" with Not_found -> error (s_type (print_context()) t1 ^ "has no field hasNext()") p)) (tfun [] basic.tbool) e1.epos in
 	let ehasnext = mk (TCall(ehasnext,[])) basic.tbool ehasnext.epos in
 	let enext = mk (TField(ev',quick_field t1 "next")) (tfun [] v.v_type) e1.epos in
 	let enext = mk (TCall(enext,[])) v.v_type e1.epos in