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

Incompatible with using Revise #13

Closed
BeastyBlacksmith opened this issue May 2, 2023 · 4 comments · Fixed by #31 or #36
Closed

Incompatible with using Revise #13

BeastyBlacksmith opened this issue May 2, 2023 · 4 comments · Fixed by #31 or #36
Labels
bug Something isn't working

Comments

@BeastyBlacksmith
Copy link
Owner

BeastyBlacksmith commented May 2, 2023

using ProtoStucts when Revise is loaded errors on method deletion.

Can't reproduce yet. More info needed.

@BeastyBlacksmith
Copy link
Owner Author

A bit unclear if #31 fixed this

@Eben60
Copy link
Contributor

Eben60 commented Feb 11, 2024

I'm not sure if I have the same error: here a way to reproduce it (Julia 1.10 on Apple Silicon).

Create a file "src/ProtoTest.jl":

using ProtoStructs

@proto struct Foo
    x :: Int
    # y :: Int
end

In a fresh Julia session:

julia> using Revise; includet("src/ProtoTest.jl")

Now uncomment the "y-line" in "src/ProtoTest.jl" and save it.

julia> Foo(42, 43)
┌ Error: Failed to revise /Users/.../ProtoTest.jl
│   exception =
│    AssertionError: ld[idx] < typemax(eltype(ld))
│    Stacktrace:
│     [1] (::Revise.var"#76#78"{OrderedCollections.OrderedDict{Revise.RelocatableExpr, Union{Nothing, Vector{Any}}}, OrderedCollections.OrderedDict{Revise.RelocatableExpr, Union{Nothing, Vector{Any}}}})()
│       @ Revise ~/.julia/packages/Revise/FaTes/src/packagedef.jl:269
└ @ Revise ~/.julia/packages/Revise/FaTes/src/packagedef.jl:724

@Tortar
Copy link
Contributor

Tortar commented Feb 11, 2024

I guess the problem is with the macro re-evaluation e.g. this works

using ProtoStructs

eval(@macroexpand @proto struct Foo
    x :: Int
    y :: Int
end)

@BeastyBlacksmith
Copy link
Owner Author

julia> Foo(42, 43)
┌ Error: Failed to revise /Users/.../ProtoTest.jl
│ exception =
│ AssertionError: ld[idx] < typemax(eltype(ld))
│ Stacktrace:
│ [1] (::Revise.var"#76#78"{OrderedCollections.OrderedDict{Revise.RelocatableExpr, Union{Nothing, Vector{Any}}}, OrderedCollections.OrderedDict{Revise.RelocatableExpr, Union{Nothing, Vector{Any}}}})()
│ @ Revise ~/.julia/packages/Revise/FaTes/src/packagedef.jl:269
└ @ Revise ~/.julia/packages/Revise/FaTes/src/packagedef.jl:724

@timholy excuse me to ping you like this, but do you happen to know which assumption I am violating here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants