Mercurial > repos > public > sbplib_julia
changeset 1815:3ada7e9be4d6 feature/jet_aqua
Restrict method signature to avoid ambiguities
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 10 Oct 2024 15:16:29 +0200 |
parents | 9a92e1b354a1 |
children | 77f1b027d134 |
files | src/RegionIndices/RegionIndices.jl |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/RegionIndices/RegionIndices.jl Thu Oct 10 15:15:51 2024 +0200 +++ b/src/RegionIndices/RegionIndices.jl Thu Oct 10 15:16:29 2024 +0200 @@ -25,7 +25,7 @@ Index(R::Type{<:Region}, T::Type{<:Integer}) = Index{R,T} IndexTupleType(T::Type{<:Integer},R::NTuple{N, DataType} where N) = Tuple{Index.(R, T)...} -Base.convert(::Type{T}, i::Index{R,T} where R) where T = i.i +Base.convert(::Type{T}, i::Index{R,T} where R) where T <: Integer = i.i Base.convert(::Type{CartesianIndex}, I::NTuple{N,Index} where N) = CartesianIndex(convert.(Int, I)) Base.Int(I::Index) = I.i