Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix struct revision #888

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/lowered.jl
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,20 @@
end
end
elseif LoweredCodeUtils.is_assignment_like(stmt)
# If we're here, either isrequired[pc] is true, or the mode forces us to eval assignments
pc = step_expr!(recurse, frame, stmt, true)
# in 1.12+ structs are Revise-able
# So if stmt is a Core._structtype call, we need to evaluate it
if VERSION >= v"1.12.0-0" &&
stmt.args[2] isa Expr &&
stmt.args[2].head === :call &&
stmt.args[2].args[1] isa QuoteNode &&
stmt.args[2].args[1].value === Core._structtype
println("evaluating $stmt")
Core.eval(mod, stmt)
pc = next_or_nothing!(frame)

Check warning on line 454 in src/lowered.jl

View check run for this annotation

Codecov / codecov/patch

src/lowered.jl#L452-L454

Added lines #L452 - L454 were not covered by tests
else
# If we're here, either isrequired[pc] is true, or the mode forces us to eval assignments
pc = step_expr!(recurse, frame, stmt, true)
end
elseif head === :call
f = @lookup(frame, stmt.args[1])
if f === Core.eval
Expand Down
Loading