# Custom promote\_rule not working

**URL:** <https://discourse.julialang.org/t/custom-promote-rule-not-working/65853>\
**Category:** General Usage\
**Created:** [August 5, 2021, 1:33am UTC](https://discourse.julialang.org/t/custom-promote-rule-not-working/65853 "2021-08-05T01:33:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Ainsworth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samuel_ainsworth/32/15644_2.png) [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Post date:** [August 5, 2021, 1:33am UTC](https://discourse.julialang.org/t/custom-promote-rule-not-working/65853/1 "2021-08-05T01:33:54Z")

</div>

I’m running Julia 1.6.2. Not sure what’s going wrong here:

```julia
struct Foo end
Base.promote_rule(::Type{Foo}, ::Type{Float64}) = Foo
@show Base.promote(Foo, Float64)

```

I get

```julia
$ julia bug.jl
Base.promote(Foo, Float64) = (Foo, Float64)

```

whereas I’d expect it to return `Foo`.

I believe I’m following the [docs](https://docs.julialang.org/en/v1/manual/conversion-and-promotion/#Defining-Promotion-Rules) almost word-for-word. What’s going on here?

---

<div class="post-metadata">

**Author:** ![Samuel\_Ainsworth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samuel_ainsworth/32/15644_2.png) [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Post date:** [August 5, 2021, 1:35am UTC](https://discourse.julialang.org/t/custom-promote-rule-not-working/65853/2 "2021-08-05T01:35:15Z")

</div>

`promote` != `promote_type`.

```julia
Base.promote_type(Foo, Float64) = Foo

```
