String changed behaviour in Julia 1.1

string(String[]) seems to be a no-op in Julia 1.1.
In 1.0.3. this worked as intended for me (see below).
Was this change intentional?

Note that string.(String[])!=string(String[]) in v1.0.3

It is breaking some code of mine (which expects that the “string” function returns a string)

julia> versioninfo()
Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
  JULIA_BINDIR = C:\Julia-1.X\bin\
  JULIA_EDITOR = "C:\Program Files (x86)\Notepad++\notepad++.exe"
  JULIA_HOME = C:\Julia-1.X\bin\

julia> string(String[])
"String[]"

julia> string(Int32[])
"Int32[]"

julia> string(Float64[])
"Float64[]"
julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_BINDIR = C:\Julia-1.1.0\bin\
  JULIA_EDITOR = "C:\Program Files (x86)\Notepad++\notepad++.exe"
  JULIA_HOME = C:\Julia-1.1.0\bin\

julia> string(Int32[])
"Int32[]"

julia> string(String[])
0-element Array{String,1}

Yep, the infamous Pkg does a nonsensical type piracy. · Issue #1034 · JuliaLang/Pkg.jl · GitHub, see also Piracy in the StdLibs · Issue #30945 · JuliaLang/julia · GitHub.

1 Like

Thanks.
I gather this will be fixed in 1.2 (or actually might already be fixed on nightly), correct?
Actually my tests on the windows nightly fail, while my tests on the linux nightly succeed.

Yes, and 1.1.1.

Yes, as of Bump Pkg to 1.2-alpha-ish. by fredrikekre · Pull Request #31116 · JuliaLang/julia · GitHub

1 Like