-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorerror handlingHandling of exceptions by Julia or the userHandling of exceptions by Julia or the userregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Description
Example (encountered while working on #13547):
julia> Array{Type{Int64}}([Float32])
ERROR: TypeError: copy!: in typeassert, expected Type{Int64}, got Type{Float32}
[inlined code] from operators.jl:313
in copy! at abstractarray.jl:301
[inlined code] from abstractarray.jl:112
in call at essentials.jl:116
The line abstractarray.jl:301
is correct, but the other 3 line numbers are completely wrong. I believe the fix is for the inliner to insert some kind of location "pop" operation. For example we have
julia> @code_typed Array{Type{Int64}}([Float32])
1-element Array{Any,1}:
:($(Expr(:lambda, Any[symbol("#s1"),:arg], Any[Any[Any[symbol("#s1"),Type{Array{Type{Int64},N}},0],Any[:arg,Array{DataType,1},0]],Any[],Any[Int64,Int64,Array{Type{Int64},1}],Any[:T]], :(begin # essentials.jl, line 58: # array.jl, line 229: # array.jl, line 230: # array.jl, line 158: # array.jl, line 48:
GenSym(0) = (Base.arraysize)(arg::Array{DataType,1},1)::Int64 # essentials.jl, line 204: # essentials.jl, line 194: # essentials.jl, line 114: # essentials.jl, line 61: # essentials.jl, line 116:
...
We see several line nodes piled up, without knowing their nesting structure.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorerror handlingHandling of exceptions by Julia or the userHandling of exceptions by Julia or the userregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version