浏览代码

fixed some rare case of constraint type addition (fixed issue #1108)

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

+ 6 - 0
typer.ml

@@ -1064,6 +1064,12 @@ let rec type_binop ctx op e1 e2 p =
 			t
 		| KParam _, KFloat | KFloat, KParam _ | KParam _, KParam _ ->
 			tfloat
+		| KParam t, KUnk ->
+			unify ctx e2.etype tfloat e2.epos;
+			tfloat
+		| KUnk, KParam t ->
+			unify ctx e1.etype tfloat e1.epos;
+			tfloat
 		| KParam _, _
 		| _, KParam _
 		| KOther, _