Skip to content

State dependent type construction? #16618

@ivirshup

Description

@ivirshup

Basically, instantiating one of these types before the other causes instantiation of the latter to throw an UndefRefError.

julia> Dict{Tuple{Vararg{Any,2}},Float64}()
Dict{Tuple{Vararg{Any,2}},Float64} with 0 entries

julia> Dict{Tuple{Any, Any},Float64}()
ERROR: UndefRefError: access to undefined reference
 in copy!(::Base.LinearFast, ::Array{Tuple{Any,Any},1}, ::Base.LinearFast, ::Array{Tuple{Vararg{Any,2}},1}) at ./abstractarray.jl:254
 in Dict{Tuple{Any,Any},Float64}() at ./dict.jl:429
 in eval(::Module, ::Any) at ./boot.jl:225
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46

In a new session

julia> Dict{Tuple{Any, Any},Float64}()
Dict{Tuple{Any,Any},Float64} with 0 entries

julia> Dict{Tuple{Vararg{Any,2}},Float64}()
ERROR: UndefRefError: access to undefined reference
 in copy!(::Base.LinearFast, ::Array{Tuple{Vararg{Any,2}},1}, ::Base.LinearFast, ::Array{Tuple{Any,Any},1}) at ./abstractarray.jl:254
 in Dict{Tuple{Vararg{Any,2}},Float64}() at ./dict.jl:429
 in eval(::Module, ::Any) at ./boot.jl:225
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46
julia> versioninfo()
Julia Version 0.5.0-dev+4361
Commit bc56e32 (2016-05-27 12:01 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.5.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, has well)

I found this in JuMP occurring with calls to JuMP._similar from getvalue. Similar errors didn't occur for Arrays, or a user defined type, so I think it's Dict specific. The value type doesn't seem to matter to this error.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorneeds testsUnit tests are required for this change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions