浏览代码

don't use imported enums in type_expr_with_type Ident (fixed issue #573)

Nicolas Cannasse 13 年之前
父节点
当前提交
7e93a82c20
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      typer.ml

+ 6 - 1
typer.ml

@@ -1325,9 +1325,14 @@ and type_expr_with_type_raise ctx e t =
 				ctx.param_type <- old;
 				raise exc)
 	| (EConst (Ident s | Type s),p) ->
+		let old = ctx.local_types in
+		ctx.local_types <- [];
 		(try
-			acc_get ctx (type_ident ctx s (match fst e with EConst (Ident _) -> false | _ -> true) p MGet) p
+			let e = acc_get ctx (type_ident ctx s (match fst e with EConst (Ident _) -> false | _ -> true) p MGet) p in
+			ctx.local_types <- old;
+			e
 		with Not_found -> try
+			ctx.local_types <- old;
 			(match t with
 			| None -> raise Not_found
 			| Some t ->