Skip to content

Commit cc607bb

Browse files
authored
fix #642 (#643)
The fix in #641 accidentally introduced a bug for keyword functions with static parameters
1 parent 376d172 commit cc607bb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/breakpoints.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ function framecode_matches_breakpoint(framecode::FrameCode, bp::BreakpointSignat
9898
bp.f isa Method && return meth === bp.f
9999
f = extract_function_from_method(meth)
100100
if !(bp.f === f || @static isdefined(Core, :kwcall) ?
101-
f === Core.kwcall && bp.f isa meth.sig.parameters[3] :
101+
f === Core.kwcall && let ftype = Base.unwrap_unionall(meth.sig).parameters[3]
102+
!Base.has_free_typevars(ftype) && bp.f isa ftype
103+
end :
102104
Core.kwfunc(bp.f) === f
103105
)
104106
return false

test/breakpoints.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,4 +593,10 @@ end
593593
fkw2(;x=1) = x
594594
g2() = fkw2(; x=1)
595595
@test @interpret g2() === 1
596+
597+
fkw3(::T; x=1) where {T} = x
598+
breakpoint(fkw3)
599+
g3() = fkw3(7; x=1)
600+
frame, bp = @interpret g3()
601+
@test isa(frame, Frame) && isa(bp, JuliaInterpreter.BreakpointRef)
596602
end

0 commit comments

Comments
 (0)