You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-2412:55 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin19.6.0)
CPU:Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS =4
julia> x = Vararg{Any}
Vararg{Any, N} where N
julia>fieldnames(typeof(x))
(:var, :body)
julia> x.var
N
julia> x.body
Vararg{Any, N}
julia>versioninfo()
Julia Version 1.7.0-beta3.0
Commit e76c9dad42 (2021-07-0708:12 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU:Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-12.0.0 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS =4
julia> x = Vararg{Any}
Vararg{Any}
julia>fieldnames(typeof(x))
(:T, :N)
julia> x.T
Any
julia> x.N
ERROR: UndefRefError: access to undefined reference
Stacktrace:
[1] getproperty(x::Core.TypeofVararg, f::Symbol)
@ Base ./Base.jl:42
[2] top-level scope
@ REPL[48]:1
I'm not sure what the correct fix here should be w.r.t. BSON.jl, but it seems like accessing x.N should not error or fieldnames(typeof(x)) should not contain :N.
The text was updated successfully, but these errors were encountered:
The N field exists but is undefined when the length is unspecified. In general objects can have undefined fields, so that needs to be handled by any code that looks at object fields generically. For example
julia> struct X
field
X() = new()
end
julia> X().field
ERROR: UndefRefError: access to undefined reference
julia> fieldnames(X)
(:field,)
I ran into this trying to fix BSON.jl: JuliaIO/BSON.jl#102.
I'm not sure what the correct fix here should be w.r.t. BSON.jl, but it seems like accessing
x.N
should not error orfieldnames(typeof(x))
should not contain:N
.The text was updated successfully, but these errors were encountered: