浏览代码

hack differently

Simon Krajewski 6 年之前
父节点
当前提交
458c40cef9
共有 2 个文件被更改,包括 2 次插入5 次删除
  1. 1 4
      src/core/type.ml
  2. 1 1
      src/optimization/analyzer.ml

+ 1 - 4
src/core/type.ml

@@ -1868,20 +1868,17 @@ module Monomorph = struct
 				bind m t
 			end;
 		| _ ->
-			let hack = ref false in
 			Option.may (fun (cstr,path,p) -> match cstr with
 				| CStructure(tanon,anon) ->
 					if not (PMap.is_empty anon.a_fields) then check_constraint path (fun () ->
 						unify_merge t tanon;
-						hack := true;
-						m.tm_type <- Some tanon; (* HACK *)
 					)
 				| CTypes tl ->
 					check_constraint path (fun () ->
 						List.iter (unify_merge t) tl
 					)
 			) m.tm_constraint;
-			if not !hack then do_bind m t; (* HACK *)
+			do_bind m t;
 		end
 
 	let unbind m =

+ 1 - 1
src/optimization/analyzer.ml

@@ -1050,7 +1050,7 @@ module Run = struct
 				debug();
 				raise exc
 			in
-			let e = reduce_control_flow ctx e in
+			let e = Optimizer.reduce_expression ctx e in
 			begin match config.debug_kind with
 				| DebugNone -> ()
 				| DebugDot -> Debug.dot_debug actx c cf;