Skip to content

x.*x not customizable #22053

@malmaud

Description

@malmaud

There doesn't seem to be a way to get x.*x to do something different than x*x, as the following perhaps naive example shows:

import Base: *

type T
    t
end

Base.broadcast(::typeof(*), t1::T, t2::T) = 1
*(t1::T, t2::T) = 2
x = T(1)
x*x # Prints 2

x.*x # Also prints 2

If there really isn't a way, this is a non-trivial breaking regression in functionality compared to .5 that some packages depended upon.

Metadata

Metadata

Assignees

Labels

broadcastApplying a function over a collection

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions