@@ -3379,22 +3379,22 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
33793379 let result_type =
33803380 match (lhs_type.desc, specialization) with
33813381 | Tconstr (path , _ , _ ), _ when Path. same path Predef. path_int ->
3382- Predef. type_int
3382+ instance_def Predef. type_int
33833383 | Tconstr (path, _, _), {bool = Some _}
33843384 when Path. same path Predef. path_bool ->
3385- Predef. type_bool
3385+ instance_def Predef. type_bool
33863386 | Tconstr (path, _, _), {float = Some _}
33873387 when Path. same path Predef. path_float ->
3388- Predef. type_float
3388+ instance_def Predef. type_float
33893389 | Tconstr (path, _, _), {bigint = Some _}
33903390 when Path. same path Predef. path_bigint ->
3391- Predef. type_bigint
3391+ instance_def Predef. type_bigint
33923392 | Tconstr (path, _, _), {string = Some _}
33933393 when Path. same path Predef. path_string ->
3394- Predef. type_string
3394+ instance_def Predef. type_string
33953395 | _ ->
3396- unify env lhs_type Predef. type_int;
3397- Predef. type_int
3396+ unify env lhs_type (instance_def Predef. type_int) ;
3397+ instance_def Predef. type_int
33983398 in
33993399 let targs = [(to_noloc lhs_label, Some lhs)] in
34003400 Some (targs, result_type)
@@ -3409,50 +3409,50 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
34093409 match (lhs_type.desc, specialization) with
34103410 | Tconstr (path , _ , _ ), _ when Path. same path Predef. path_int ->
34113411 let rhs = type_expect env rhs_expr Predef. type_int in
3412- (lhs, rhs, Predef. type_int)
3412+ (lhs, rhs, instance_def Predef. type_int)
34133413 | Tconstr (path, _, _), {bool = Some _}
34143414 when Path. same path Predef. path_bool ->
34153415 let rhs = type_expect env rhs_expr Predef. type_bool in
3416- (lhs, rhs, Predef. type_bool)
3416+ (lhs, rhs, instance_def Predef. type_bool)
34173417 | Tconstr (path, _, _), {float = Some _}
34183418 when Path. same path Predef. path_float ->
34193419 let rhs = type_expect env rhs_expr Predef. type_float in
3420- (lhs, rhs, Predef. type_float)
3420+ (lhs, rhs, instance_def Predef. type_float)
34213421 | Tconstr (path, _, _), {bigint = Some _}
34223422 when Path. same path Predef. path_bigint ->
34233423 let rhs = type_expect env rhs_expr Predef. type_bigint in
3424- (lhs, rhs, Predef. type_bigint)
3424+ (lhs, rhs, instance_def Predef. type_bigint)
34253425 | Tconstr (path, _, _), {string = Some _}
34263426 when Path. same path Predef. path_string ->
34273427 let rhs = type_expect env rhs_expr Predef. type_string in
3428- (lhs, rhs, Predef. type_string)
3428+ (lhs, rhs, instance_def Predef. type_string)
34293429 | _ -> (
34303430 (* Rule 2. Try unifying to rhs *)
34313431 match (rhs_type.desc, specialization) with
34323432 | Tconstr (path , _ , _ ), _ when Path. same path Predef. path_int ->
34333433 let lhs = type_expect env lhs_expr Predef. type_int in
3434- (lhs, rhs, Predef. type_int)
3434+ (lhs, rhs, instance_def Predef. type_int)
34353435 | Tconstr (path, _, _), {bool = Some _}
34363436 when Path. same path Predef. path_bool ->
34373437 let lhs = type_expect env lhs_expr Predef. type_bool in
3438- (lhs, rhs, Predef. type_bool)
3438+ (lhs, rhs, instance_def Predef. type_bool)
34393439 | Tconstr (path, _, _), {float = Some _}
34403440 when Path. same path Predef. path_float ->
34413441 let lhs = type_expect env lhs_expr Predef. type_float in
3442- (lhs, rhs, Predef. type_float)
3442+ (lhs, rhs, instance_def Predef. type_float)
34433443 | Tconstr (path, _, _), {bigint = Some _}
34443444 when Path. same path Predef. path_bigint ->
34453445 let lhs = type_expect env lhs_expr Predef. type_bigint in
3446- (lhs, rhs, Predef. type_bigint)
3446+ (lhs, rhs, instance_def Predef. type_bigint)
34473447 | Tconstr (path, _, _), {string = Some _}
34483448 when Path. same path Predef. path_string ->
34493449 let lhs = type_expect env lhs_expr Predef. type_string in
3450- (lhs, rhs, Predef. type_string)
3450+ (lhs, rhs, instance_def Predef. type_string)
34513451 | _ ->
34523452 (* Rule 3. Fallback to int *)
34533453 let lhs = type_expect env lhs_expr Predef. type_int in
34543454 let rhs = type_expect env rhs_expr Predef. type_int in
3455- (lhs, rhs, Predef. type_int))
3455+ (lhs, rhs, instance_def Predef. type_int))
34563456 in
34573457 let targs =
34583458 [(to_noloc lhs_label, Some lhs); (to_noloc rhs_label, Some rhs)]
0 commit comments