@@ -402,7 +402,7 @@ function _promote_type_binary_detect_loop(T::Type, S::Type, A::Type, B::Type)
402
402
onesided (T, S, A, B) || onesided (T, S, B, A)
403
403
end
404
404
405
- macro _promote_type_binary_step ()
405
+ macro _promote_type_binary_step1 ()
406
406
e = quote
407
407
# Try promote_rule in both orders.
408
408
ts = promote_rule (T, S)
@@ -425,12 +425,26 @@ macro _promote_type_binary_step()
425
425
# makes for nicer UX.
426
426
_promote_type_binary_err_detected_infinite_recursion (T_initial, S_initial, T, S, ts, st)
427
427
end
428
+ end
429
+ esc (e)
430
+ end
431
+
432
+ macro _promote_type_binary_step2 ()
433
+ e = quote
428
434
T = ts
429
435
S = st
430
436
end
431
437
esc (e)
432
438
end
433
439
440
+ macro _promote_type_binary_step ()
441
+ e = quote
442
+ @_promote_type_binary_step1
443
+ @_promote_type_binary_step2
444
+ end
445
+ esc (e)
446
+ end
447
+
434
448
function _promote_type_binary (T:: Type , S:: Type )
435
449
T_initial = T
436
450
S_initial = S
@@ -442,7 +456,8 @@ function _promote_type_binary(T::Type, S::Type)
442
456
@_promote_type_binary_step
443
457
@_promote_type_binary_step
444
458
@_promote_type_binary_step
445
- @_promote_type_binary_step
459
+
460
+ @_promote_type_binary_step1
446
461
447
462
_promote_type_binary_err_giving_up (T_initial, S_initial, T, S, ts, st)
448
463
end
0 commit comments