|
18 | 18 | function step_through_frame(frame_creator) |
19 | 19 | rets = [] |
20 | 20 | for cmd in ALL_COMMANDS |
21 | | - frame = frame_creator() |
| 21 | + frame = frame_creator() |
22 | 22 | ret = step_through_command(frame, cmd) |
23 | 23 | push!(rets, ret) |
24 | 24 | end |
|
28 | 28 | step_through(f, args...; kwargs...) = step_through_frame(() -> enter_call(f, args...; kwargs...)) |
29 | 29 | step_through(expr::Expr) = step_through_frame(() -> enter_call_expr(expr)) |
30 | 30 |
|
31 | | -@generated function generatedfoo(T) |
32 | | - :(return $T) |
| 31 | +@generated function generatedfoo(x) |
| 32 | + :(return x) |
33 | 33 | end |
34 | 34 | callgenerated() = generatedfoo(1) |
35 | 35 | @generated function generatedparams(a::Array{T,N}) where {T,N} |
@@ -91,23 +91,23 @@ struct B{T} end |
91 | 91 | @test isa(pc, BreakpointRef) |
92 | 92 | @test JuliaInterpreter.scopeof(f).name == :generatedfoo |
93 | 93 | stmt = JuliaInterpreter.pc_expr(f) |
94 | | - @test stmt.head == :return && stmt.args[1] === Int |
| 94 | + @test stmt.head == :return |
95 | 95 | @test debug_command(frame, :c) === nothing |
96 | 96 | @test frame.callee === nothing |
97 | | - @test get_return(frame) === Int |
| 97 | + @test get_return(frame) === 1 |
98 | 98 | # This time, step into the generated function itself |
99 | 99 | frame = enter_call_expr(:($(callgenerated)())) |
100 | 100 | f, pc = debug_command(frame, :sg) |
101 | 101 | @test isa(pc, BreakpointRef) |
102 | 102 | @test JuliaInterpreter.scopeof(f).name == :generatedfoo |
103 | 103 | stmt = JuliaInterpreter.pc_expr(f) |
104 | | - @test stmt.head == :return && @lookup(f, stmt.args[1]) === 1 |
| 104 | + @test stmt.head == :return |
105 | 105 | f2, pc = debug_command(f, :finish) |
106 | 106 | @test JuliaInterpreter.scopeof(f2).name == :callgenerated |
107 | 107 | # Now finish the regular function |
108 | 108 | @test debug_command(frame, :finish) === nothing |
109 | 109 | @test frame.callee === nothing |
110 | | - @test get_return(frame) === 1 |
| 110 | + @test get_return(frame) === Int |
111 | 111 |
|
112 | 112 | # Parametric generated function (see #157) |
113 | 113 | frame = fr = JuliaInterpreter.enter_call(callgeneratedparams) |
|
0 commit comments