Skip to content

Commit

Permalink
Refactor ndims
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Nov 13, 2020
1 parent daeb258 commit 3458522
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/dummy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ end
DummyBigInt(J::UniformScaling) = DummyBigInt(J.λ)

# Broadcast
Base.ndims(::Type{DummyBigInt}) = 0
Base.broadcastable(x::DummyBigInt) = Ref(x)

Base.ndims(::DummyBigInt) = 0 # Needed in LinearAlgebra.
# The version with `DummyBigInt` without `Type` is needed in LinearAlgebra for
# Julia v1.6+.
Base.ndims(::Union{Type{DummyBigInt}, DummyBigInt}) = 0

Base.promote_rule(::Type{DummyBigInt}, ::Type{<:Union{Integer, UniformScaling{<:Integer}}}) = DummyBigInt
# `copy` on BigInt returns the same instance anyway
Expand Down

0 comments on commit 3458522

Please sign in to comment.