From 480450f21b329026c2df8076b175b3694d17c371 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Mon, 26 Aug 2024 11:09:32 +0200 Subject: [PATCH] fix #642 The fix in #641 accidentally introduced a bug for keyword functions with static parameters --- src/breakpoints.jl | 4 +++- test/breakpoints.jl | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/breakpoints.jl b/src/breakpoints.jl index fedb237a..79a580cb 100644 --- a/src/breakpoints.jl +++ b/src/breakpoints.jl @@ -98,7 +98,9 @@ function framecode_matches_breakpoint(framecode::FrameCode, bp::BreakpointSignat bp.f isa Method && return meth === bp.f f = extract_function_from_method(meth) if !(bp.f === f || @static isdefined(Core, :kwcall) ? - f === Core.kwcall && bp.f isa meth.sig.parameters[3] : + f === Core.kwcall && let ftype = Base.unwrap_unionall(meth.sig).parameters[3] + !Base.has_free_typevars(ftype) && bp.f isa ftype + end : Core.kwfunc(bp.f) === f ) return false diff --git a/test/breakpoints.jl b/test/breakpoints.jl index 7b40f5bc..ecf352c3 100644 --- a/test/breakpoints.jl +++ b/test/breakpoints.jl @@ -593,4 +593,10 @@ end fkw2(;x=1) = x g2() = fkw2(; x=1) @test @interpret g2() === 1 + + fkw3(::T; x=1) where {T} = x + breakpoint(fkw3) + g3() = fkw3(7; x=1) + frame, bp = @interpret g3() + @test isa(frame, Frame) && isa(bp, JuliaInterpreter.BreakpointRef) end