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

Conversation

IanButterworth
Copy link
Contributor

With JuliaLang/julia#57253 merged structs are now modifiable, which works in the repl, but doesn't appear to in Revise.

Here just modifying a struct in Example to add a new field.

julia> using Revise, Example

julia> Example.Foo(1)
Example.Foo(1)

julia> Example.Foo(1,2)
ERROR: MethodError: no method matching Example.Foo(::Int64, ::Int64)
The type `Example.Foo` exists, but no method is defined for this combination of argument types when trying to construct it.
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

This PR is a trial-and-error attempt to figure it out. I'm opening it mainly as breadcrumbs incase this is helpful for figuring out the real fix.

With this the eval fails,

julia> Example.Foo(1)
evaluating _J1 = ($(QuoteNode(Core._structtype)))(Example, :Foo, %J3, %J4, %J5, false, 2)
┌ Error: Failed to revise /Users/ian/.julia/dev/Example/src/Example.jl
│   exception =
│    syntax: invalid assignment location "JuliaInterpreter.SlotNumber(id=1)"
│    Stacktrace:
│     [1] top-level scope
│       @ ~/.julia/dev/Example/src/Example.jl:4
│    Revise evaluation error at /Users/ian/.julia/dev/Example/src/Example.jl:4
│
└ @ Revise ~/Documents/GitHub/Revise.jl/src/packagedef.jl:776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant