瀏覽代碼

moved Type.is_value_type to matcher.ml

Simon Krajewski 12 年之前
父節點
當前提交
6ca52f9e2e
共有 2 個文件被更改,包括 12 次插入12 次删除
  1. 12 0
      matcher.ml
  2. 0 12
      type.ml

+ 12 - 0
matcher.ml

@@ -246,6 +246,18 @@ let unify_enum_field en pl ef t =
 let unify ctx a b p =
 let unify ctx a b p =
 	try unify_raise ctx a b p with Error (Unify l,p) -> error (error_msg (Unify l)) p
 	try unify_raise ctx a b p with Error (Unify l,p) -> error (error_msg (Unify l)) p
 
 
+let rec is_value_type = function
+	| TMono r ->
+		(match !r with None -> false | Some t -> is_value_type t)
+	| TType (t,tl) ->
+		is_value_type (apply_params t.t_types tl t.t_type)
+	| TInst({cl_path=[],"String"},[]) ->
+		true
+	| TAbstract _ ->
+		true
+	| _ ->
+		false
+
 let to_pattern mctx e st =
 let to_pattern mctx e st =
 	let ctx = mctx.ctx in
 	let ctx = mctx.ctx in
 	let perror p = error "Unrecognized pattern" p in
 	let perror p = error "Unrecognized pattern" p in

+ 0 - 12
type.ml

@@ -627,18 +627,6 @@ let rec is_null = function
 	| _ ->
 	| _ ->
 		false
 		false
 
 
-let rec is_value_type = function
-	| TMono r ->
-		(match !r with None -> false | Some t -> is_value_type t)
-	| TType (t,tl) ->
-		is_value_type (apply_params t.t_types tl t.t_type)
-	| TInst({cl_path=[],"String"},[]) ->
-		true
-	| TAbstract _ ->
-		true
-	| _ ->
-		false
-
 let rec link e a b =
 let rec link e a b =
 	(* tell if setting a == b will create a type-loop *)
 	(* tell if setting a == b will create a type-loop *)
 	let rec loop t =
 	let rec loop t =