@@ -165,7 +165,9 @@ function framecode_matches_breakpoint(framecode::FrameCode, bp::BreakpointFileLo
165165 return false
166166 end
167167 else
168- path, _ = whereis (framecode, 1 )
168+ w = whereis (framecode, 1 )
169+ w === nothing && return false
170+ path, _ = w
169171 path = CodeTracking. maybe_fix_path (path)
170172 ispath (path) && (path = realpath (path))
171173
@@ -186,7 +188,6 @@ function shouldbreak(frame::Frame, pc::Int)
186188end
187189
188190function prepare_slotfunction (framecode:: FrameCode , body:: Union{Symbol,Expr} )
189- ismeth = framecode. scope isa Method
190191 uslotnames = Set {Symbol} ()
191192 slotnames = Symbol[]
192193 for name in framecode. src. slotnames
@@ -223,13 +224,14 @@ function prepare_slotfunction(framecode::FrameCode, body::Union{Symbol,Expr})
223224 push! (assignments, :($ maxexsym = $ maxexpr))
224225 push! (assignments, :($ slotname = $ maxexsym > 0 ? something ($ dataname. locals[$ maxexsym]) : $ default))
225226 end
226- if ismeth
227- syms = sparam_syms (framecode. scope)
227+ scope = framecode. scope
228+ if isa (scope, Method)
229+ syms = sparam_syms (scope)
228230 for i = 1 : length (syms)
229231 push! (assignments, Expr (:(= ), syms[i], :($ dataname. sparams[$ i])))
230232 end
231233 end
232- funcname = ismeth ? gensym (" slotfunction" ) : gensym (Symbol (framecode . scope, " _slotfunction" ))
234+ funcname = isa (scope, Method) ? gensym (" slotfunction" ) : gensym (Symbol (scope, " _slotfunction" ))
233235 return Expr (:function , Expr (:call , funcname, framename), Expr (:block , assignments... , body))
234236end
235237
0 commit comments