# Criteria for defining both \`promote\_rule(::A, ::B)\` and \`promote\_rule(::B, ::A)\`

**URL:** <https://discourse.julialang.org/t/criteria-for-defining-both-promote-rule-a-b-and-promote-rule-b-a/143304>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 29, 2026, 10:41am UTC](https://discourse.julialang.org/t/criteria-for-defining-both-promote-rule-a-b-and-promote-rule-b-a/143304 "2026-11-29T10:41:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [November 29, 2026, 10:41am UTC](https://discourse.julialang.org/t/criteria-for-defining-both-promote-rule-a-b-and-promote-rule-b-a/143304/1 "2026-11-29T10:41:24Z")

</div>

Generally speaking, since `promote_type` adds symmetry, it is not necessary to define both `promote_rule(::A, ::B)` and `promote_rule(::B, ::A)`.

> **[Defining Promotion Rules - Conversion and Promotion · The Julia Language](https://docs.julialang.org/en/v1.13/manual/conversion-and-promotion/#Defining-Promotion-Rules)**
>
> Julia has a system for promoting arguments of mathematical operators to a common type, which has been mentioned in various other sections, including Integers and Floating-Point Numbers, Mathematical Operations and Elementary Functions, Types, and...

However, in practice, defining only one of them doesn’t work in some cases.  
This is due to asymmetries in `Base`/`Core` and ambiguities that arise between rules in `Base` and those in other packages.  
So, is defining both really the best solution?  
Generally speaking, adding a rule increases the risk of conflicts with other rules.  
Furthermore, I believe it is impossible to fully control rules as long as you use non-concrete types that you do not own.

I thought that since the rules are incomplete anyway, it might be better to reduce their number.  
Example: [Reduce the `promote_rule`s for `Dual` - Pull Request #879 - JuliaDiff/ForwardDiff.jl - GitHub](https://github.com/JuliaDiff/ForwardDiff.jl/pull/879)

However, it is a fact that problems remain, and I am not confident in my judgment.  
Are there any requirements or guidelines that make it appropriate to add both definitions?
