Bläddra i källkod

don't bind print_context globally

Simon Krajewski 8 år sedan
förälder
incheckning
6f71e98b3b
3 ändrade filer med 5 tillägg och 5 borttagningar
  1. 1 1
      src/generators/gencommon.ml
  2. 2 2
      src/typing/matcher.ml
  3. 2 2
      src/typing/type.ml

+ 1 - 1
src/generators/gencommon.ml

@@ -130,7 +130,7 @@ let path_of_md_def md_def =
 		| [TClassDecl c] -> c.cl_path
 		| [TClassDecl c] -> c.cl_path
 		| _ -> md_def.m_path
 		| _ -> md_def.m_path
 
 
-let debug_type = (s_type (print_context()))
+let debug_type t = (s_type (print_context())) t
 let debug_expr = s_expr debug_type
 let debug_expr = s_expr debug_type
 
 
 let debug_mode = ref false
 let debug_mode = ref false

+ 2 - 2
src/typing/matcher.ml

@@ -25,8 +25,8 @@ open Error
 
 
 exception Internal_match_failure
 exception Internal_match_failure
 
 
-let s_type = s_type (print_context())
-let s_expr_pretty = s_expr_pretty false "" false s_type
+let s_type t = s_type (print_context()) t
+let s_expr_pretty e = s_expr_pretty false "" false s_type e
 
 
 let fake_tuple_type = TInst(mk_class null_module ([],"-Tuple") null_pos null_pos, [])
 let fake_tuple_type = TInst(mk_class null_module ([],"-Tuple") null_pos null_pos, [])
 
 

+ 2 - 2
src/typing/type.ml

@@ -1268,8 +1268,8 @@ let s_class_kind = function
 
 
 module Printer = struct
 module Printer = struct
 
 
-	let s_type =
-		s_type (print_context())
+	let s_type t =
+		s_type (print_context()) t
 
 
 	let s_pair s1 s2 =
 	let s_pair s1 s2 =
 		Printf.sprintf "(%s,%s)" s1 s2
 		Printf.sprintf "(%s,%s)" s1 s2