Skip to content

inlined code line numbers need work #13725

@JeffBezanson

Description

@JeffBezanson

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

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorerror handlingHandling of exceptions by Julia or the userregressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions