File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ function replace_coretypes_list!(list::AbstractVector; rev::Bool)
419419 end
420420 if isa (x, Core. SSAValue)
421421 return SSAValue (x. id)
422- elseif isa (x, Core. SlotNumber)
422+ elseif isa (x, Core. SlotNumber) || isa (x, Core . TypedSlot)
423423 return SlotNumber (x. id)
424424 end
425425 return x
Original file line number Diff line number Diff line change @@ -821,3 +821,23 @@ module ForInclude end
821821 ex = :(include (" dummy_file.jl" ))
822822 @test JuliaInterpreter. finish_and_return! (Frame (ForInclude, ex), true ) == 55
823823end
824+
825+ @testset " TypedSlots" begin
826+ function foo (x, y)
827+ z = x + y
828+ if z < 4
829+ z += 1
830+ end
831+ u = (x -> x + z)(x)
832+ v = Ref {Union{Int, Missing}} (x)[] + y
833+ return u + v
834+ end
835+
836+ ci = code_typed (foo, NTuple{2 , Int}; optimize= false )[][1 ]
837+ mi = Core. Compiler. method_instances (foo, NTuple{2 , Int})[]
838+
839+ frameargs = Any[foo, 1 , 2 ]
840+ framecode = JuliaInterpreter. FrameCode (mi. def, ci)
841+ frame = JuliaInterpreter. prepare_frame (framecode, frameargs, mi. sparam_vals)
842+ @test JuliaInterpreter. finish_and_return! (frame) === 8
843+ end
You can’t perform that action at this time.
0 commit comments