File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -94,21 +94,25 @@ function _make_frame(mod, arg)
9494 end
9595end
9696
97+ _check_is_call (arg) = ! (arg isa Expr && arg. head == :call ) && throw (ArgumentError (" @enter and @run should be applied to a function call" ))
98+
9799macro make_frame (arg)
98100 _make_frame (__module__, arg)
99101end
100102
101103macro enter (arg)
104+ _check_is_call (arg)
102105 quote
103- let frame = $ (_make_frame (__module__,arg))
106+ let frame = $ (_make_frame (__module__, arg))
104107 RunDebugger (frame)
105108 end
106109 end
107110end
108111
109112macro run (arg)
113+ _check_is_call (arg)
110114 quote
111- let frame = $ (_make_frame (__module__,arg))
115+ let frame = $ (_make_frame (__module__, arg))
112116 RunDebugger (frame; initial_continue= true )
113117 end
114118 end
Original file line number Diff line number Diff line change @@ -86,3 +86,8 @@ import InteractiveUtils
8686 @test JuliaInterpreter. Variable (@__FILE__ , :file , false ) in locals
8787 @test JuliaInterpreter. Variable (LINE, :line , false ) in locals
8888end
89+
90+ # These are LoadError because the error happens at macro expansion
91+ @test_throws LoadError @macroexpand @enter " foo"
92+ @test_throws LoadError @macroexpand @enter 1
93+ @test_throws LoadError @macroexpand @run [1 ,2 ]
You can’t perform that action at this time.
0 commit comments