Thanks for clarifying.
My case may be simpler than what you described: I know that all elements in the result will have the same type. Just like for matrix-vector multiplication, each operand has all elements of the same type, and linear combinations of them should result in something according to how types are promoted when doing scalar +
and *
operations. That’s why the promote_op
seemed like one way to go – until I read what people have to say about it.
Related topic: Alternatives to `Base.promote_op(op, ::Type...)` for `op::Type`?