Skip to content

"sg" should use arg types #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
timholy opened this issue Mar 16, 2019 · 0 comments
Open

"sg" should use arg types #161

timholy opened this issue Mar 16, 2019 · 0 comments

Comments

@timholy
Copy link
Member

timholy commented Mar 16, 2019

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant