-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inferenceregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Milestone
Description
This is a reduced example of some code that started failing for me. I haven't bisected it but my guess is the Vararg changes but it could also be something with when typeof is evaluated, @timholy
type Foo{dim}
c::Vector{NTuple{dim, Float64}}
end
function f()
sdim = 1+1
c = Vector{NTuple{sdim, Float64}}(1)
c[1] = (1.0, 2.0)
a = Foo{sdim}(c)
println(typeof(a.c))
return a
end
a = f()
println(typeof(a.c))Executing this on current master gives:
julia> a = f();
Array{Tuple{Vararg},1}
julia> println(typeof(a.c))
Array{Tuple{Float64,Float64},1}Inside the function, typeof(a.c) is Array{Tuple{Vararg},1} but outside it is Array{Tuple{Float64,Float64},1}. Note that this problem goes away if sdim is made a constant. This also seems to go away if instead of storing a Vector{NTuple} a simple NTuple is stored.
On an old 0.5 commit this gives the expected:
julia> a = f();
Array{Tuple{Float64,Float64},1}
julia> println(typeof(a.c))
Array{Tuple{Float64,Float64},1}Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inferenceregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version