@@ -3379,22 +3379,22 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
3379
3379
let result_type =
3380
3380
match (lhs_type.desc, specialization) with
3381
3381
| Tconstr (path , _ , _ ), _ when Path. same path Predef. path_int ->
3382
- Predef. type_int
3382
+ instance_def Predef. type_int
3383
3383
| Tconstr (path, _, _), {bool = Some _}
3384
3384
when Path. same path Predef. path_bool ->
3385
- Predef. type_bool
3385
+ instance_def Predef. type_bool
3386
3386
| Tconstr (path, _, _), {float = Some _}
3387
3387
when Path. same path Predef. path_float ->
3388
- Predef. type_float
3388
+ instance_def Predef. type_float
3389
3389
| Tconstr (path, _, _), {bigint = Some _}
3390
3390
when Path. same path Predef. path_bigint ->
3391
- Predef. type_bigint
3391
+ instance_def Predef. type_bigint
3392
3392
| Tconstr (path, _, _), {string = Some _}
3393
3393
when Path. same path Predef. path_string ->
3394
- Predef. type_string
3394
+ instance_def Predef. type_string
3395
3395
| _ ->
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
3398
3398
in
3399
3399
let targs = [(to_noloc lhs_label, Some lhs)] in
3400
3400
Some (targs, result_type)
@@ -3409,50 +3409,50 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
3409
3409
match (lhs_type.desc, specialization) with
3410
3410
| Tconstr (path , _ , _ ), _ when Path. same path Predef. path_int ->
3411
3411
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)
3413
3413
| Tconstr (path, _, _), {bool = Some _}
3414
3414
when Path. same path Predef. path_bool ->
3415
3415
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)
3417
3417
| Tconstr (path, _, _), {float = Some _}
3418
3418
when Path. same path Predef. path_float ->
3419
3419
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)
3421
3421
| Tconstr (path, _, _), {bigint = Some _}
3422
3422
when Path. same path Predef. path_bigint ->
3423
3423
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)
3425
3425
| Tconstr (path, _, _), {string = Some _}
3426
3426
when Path. same path Predef. path_string ->
3427
3427
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)
3429
3429
| _ -> (
3430
3430
(* Rule 2. Try unifying to rhs *)
3431
3431
match (rhs_type.desc, specialization) with
3432
3432
| Tconstr (path , _ , _ ), _ when Path. same path Predef. path_int ->
3433
3433
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)
3435
3435
| Tconstr (path, _, _), {bool = Some _}
3436
3436
when Path. same path Predef. path_bool ->
3437
3437
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)
3439
3439
| Tconstr (path, _, _), {float = Some _}
3440
3440
when Path. same path Predef. path_float ->
3441
3441
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)
3443
3443
| Tconstr (path, _, _), {bigint = Some _}
3444
3444
when Path. same path Predef. path_bigint ->
3445
3445
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)
3447
3447
| Tconstr (path, _, _), {string = Some _}
3448
3448
when Path. same path Predef. path_string ->
3449
3449
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)
3451
3451
| _ ->
3452
3452
(* Rule 3. Fallback to int *)
3453
3453
let lhs = type_expect env lhs_expr Predef. type_int in
3454
3454
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))
3456
3456
in
3457
3457
let targs =
3458
3458
[(to_noloc lhs_label, Some lhs); (to_noloc rhs_label, Some rhs)]
0 commit comments