Skip to content

"sg" should use arg types #161

Open
Open
@timholy

Description

@timholy

It seems that even with enter_generated the arg value, rather than arg types, are being passed to the generator. Copied over from #157 (comment):

julia> @generated function f(x)
           :(return x)
       end
f (generic function with 1 method)

julia> callf() = f("Hello")
callf (generic function with 1 method)

julia> using JuliaInterpreter

julia> fr = JuliaInterpreter.enter_call(callf)
Frame for callf() in Main at REPL[2]:1
  1 1  1%1 = (f)("Hello")
  2 1  └──      return %1

julia> fr, pc = debug_command(fr, "s")
(Frame for f(x) in Main at REPL[1]:2
  1 2  1return x
x = "Hello"
caller: callf() in Main at REPL[2]:1, breakpoint(f(x) in Main at REPL[1]:2, %0))

julia> JuliaInterpreter.locals(fr)
2-element Array{JuliaInterpreter.Variable,1}:
 #self# = f 
 x = "Hello"

julia> fr = JuliaInterpreter.enter_call(callf)
Frame for callf() in Main at REPL[2]:1
  1 1  1%1 = (f)("Hello")
  2 1  └──      return %1

julia> fr, pc = debug_command(fr, "sg")
(Frame for f(x) in Main at REPL[1]:2
  1 2  CodeInfo(quote
x = "Hello"
caller: callf() in Main at REPL[2]:1, breakpoint(f(x) in Main at REPL[1]:2, %0))

julia> JuliaInterpreter.locals(fr)
2-element Array{JuliaInterpreter.Variable,1}:
 #self# = f 
 x = "Hello"

Shouldn't x = String? Note the CodeInfo(quote in the method body; the full expansion is

julia> fr.framecode.src
CodeInfo(quote
    return x
end)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions