Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages in convert sometimes put extra braces after eltype #40643

Closed
jishnub opened this issue Apr 28, 2021 · 1 comment
Closed

Error messages in convert sometimes put extra braces after eltype #40643

jishnub opened this issue Apr 28, 2021 · 1 comment
Labels
error messages Better, more actionable error messages

Comments

@jishnub
Copy link
Contributor

jishnub commented Apr 28, 2021

julia> using OffsetArrays, LinearAlgebra

julia> convert(OffsetArray{ComplexF64,2, Diagonal{ComplexF64,Vector{ComplexF64}}}, OffsetArray(zeros(ComplexF64,3,3), 0,0))
ERROR: MethodError: Cannot `convert` an object of type 
  OffsetArray{Complex{Float64{}},2,Matrix{ComplexF64}} to an object of type 
  OffsetArray{Complex{Float64{}},2,Diagonal{ComplexF64, Vector{ComplexF64}}}
Closest candidates are:
  convert(::Type{T}, ::Factorization) where T<:AbstractArray at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/factorization.jl:58
  convert(::Type{T}, ::T) where T<:AbstractArray at abstractarray.jl:16
  convert(::Type{T}, ::T) where T at essentials.jl:228
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[16]:1

julia> VERSION
v"1.7.0-DEV.1025"

The eltype in the error message is displayed as Complex{Float64{}} instead of Complex{Float64}. This only happens for some combinations of types.

@KristofferC KristofferC added the error messages Better, more actionable error messages label Apr 28, 2021
@vtjnash
Copy link
Member

vtjnash commented Apr 28, 2021

Duplicate of #36644

@vtjnash vtjnash marked this as a duplicate of #36644 Apr 28, 2021
@vtjnash vtjnash closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages
Projects
None yet
Development

No branches or pull requests

3 participants