From 9ad754c601b27f999f074dce46acb58c94f3ef78 Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Wed, 7 Nov 2012 14:07:18 +0000 Subject: [PATCH] correctly compare abstracts in binops (fixed issue #1255) --- typer.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typer.ml b/typer.ml index cd6fbd0b6e6..81423a515fe 100644 --- a/typer.ml +++ b/typer.ml @@ -1181,7 +1181,7 @@ let rec type_binop ctx op e1 e2 p = let ok1 = unify_int ctx e1 KUnk in let ok2 = unify_int ctx e2 KUnk in if ok1 && ok2 then tint else tfloat - | KParam t1, KParam t2 when t1 == t2 -> + | KParam t1, KParam t2 when Type.type_iseq t1 t2 -> t1 | KParam t, KInt | KInt, KParam t -> t @@ -1218,7 +1218,7 @@ let rec type_binop ctx op e1 e2 p = (match classify e1.etype, classify e2.etype with | KFloat, KFloat -> result := tfloat - | KParam t1, KParam t2 when t1 == t2 -> + | KParam t1, KParam t2 when Type.type_iseq t1 t2 -> if op <> OpDiv then result := t1 | KParam _, KParam _ -> result := tfloat