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

["A";"B";;"C";"D"] works in v1.7.2 but gives an error in v1.7.3 #46133

Closed
jonaswickman opened this issue Jul 21, 2022 · 3 comments
Closed

["A";"B";;"C";"D"] works in v1.7.2 but gives an error in v1.7.3 #46133

jonaswickman opened this issue Jul 21, 2022 · 3 comments

Comments

@jonaswickman
Copy link

In julia v1.7.2 you can write

["A";"B";;"C";"D"]

which gives you a matrix:

2×2 Matrix{String}:
 "A"  "C"
 "B"  "D"

In version 1.7.3 however you get an error message:

ERROR: MethodError: no method matching size(::String, ::Int64)
Closest candidates are:
  size(::Union{LinearAlgebra.QR, LinearAlgebra.QRCompactWY, LinearAlgebra.QRPivoted}, ::Integer) at ~/Files/Programs/Julia/julia-1.7.3/share/julia/stdlib/v1.7/LinearAlgebra/src/qr.jl:566
  size(::Union{LinearAlgebra.Hermitian{T, S}, LinearAlgebra.Symmetric{T, S}} where {T, S}, ::Any) at ~/Files/Programs/Julia/julia-1.7.3/share/julia/stdlib/v1.7/LinearAlgebra/src/symmetric.jl:201
  size(::Union{LinearAlgebra.Cholesky, LinearAlgebra.CholeskyPivoted}, ::Integer) at ~/Files/Programs/Julia/julia-1.7.3/share/julia/stdlib/v1.7/LinearAlgebra/src/cholesky.jl:495
  ...
Stacktrace:
 [1] _typed_hvncat_dims(#unused#::Type{String}, dims::Tuple{Int64, Int64}, row_first::Bool, as::NTuple{4, String})
   @ Base ./abstractarray.jl:2328
 [2] _typed_hvncat(::Type, ::Tuple{Int64, Int64}, ::Bool, ::String, ::Vararg{String})
   @ Base ./abstractarray.jl:2304
 [3] _hvncat(::Tuple{Int64, Int64}, ::Bool, ::String, ::Vararg{String})
   @ Base ./abstractarray.jl:2133
 [4] hvncat(::Tuple{Int64, Int64}, ::Bool, ::String, ::Vararg{String})
   @ Base ./abstractarray.jl:2129
 [5] top-level scope
   @ REPL[2]:1

Full version info for both versions:

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
@jmkuhn
Copy link
Contributor

jmkuhn commented Jul 22, 2022

Need to backport #45365.

@giordano
Copy link
Contributor

Duplicate of #45461?

@BioTurboNick
Copy link
Contributor

BioTurboNick commented Jul 22, 2022

As a workaround, you can define

Base.size(x::String, y::Int) = Base.cat_size(x, y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants