You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm guessing this is because SumTypes emits an Expr(:toplevel, ...) object instead of an Expr(:block, ...) for the struct definition. There's some kinda scary edge cases with macros defining structs, but since the implementation of sumtypes has changed a lot, maybe we no longer need to use Expr(:toplevel) and can go back to Expr(:block).
Here's a MWE:
julia>macrofoo()
ex = :(struct Foo{X}; x::Xend)
esc(Expr(:toplevel, ex))
end@foo (macro with 1 method)
julia>beginmutable struct A{X}
x::Xend@fooend
ERROR: syntax: SlotNumber objects should not occur in an AST
Stacktrace:
[1] top-level scope
@ REPL[7]:1
[2] top-level scope
@ REPL[7]:5
For non-parametric sum types this works fine
but when you try with a parametric one a strange error with no informative stacktrace appears:
The text was updated successfully, but these errors were encountered: