# Alternatives to \`Base.promote\_op(op, ::Type...)\` for \`op::Type\`?

**URL:** https://discourse.julialang.org/t/alternatives-to-base-promote-op-op-type-for-op-type/5289
**Category:** General Usage
**Created:** [August 8, 2017, 9:03pm UTC](https://discourse.julialang.org/t/alternatives-to-base-promote-op-op-type-for-op-type/5289 "2017-08-08T21:03:16Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [August 8, 2017, 9:24pm UTC](https://discourse.julialang.org/t/alternatives-to-base-promote-op-op-type-for-op-type/5289/6 "2017-08-08T21:24:32Z")

</div>

That’s a bit of an odd requirement, though. After all, I can always implement my own type which is `<: Number` and have `sin(::MyType) = "foo"`. I don’t think we can make any statements at all about the return type of a function over an abstract type.

```julia
julia> struct Foo <: Number
       end

julia> Base.sin(::Foo) = "hello"

julia> Base.promote_op(sin, Number)
Number

julia> sin(Foo())
"hello"

```

---

_[View the full topic](https://discourse.julialang.org/t/alternatives-to-base-promote-op-op-type-for-op-type/5289)._
