Skip to content

Failed to revise due to some gensym method #782

@pepijndevos

Description

@pepijndevos

If I define a file with the following code, and revise it, it breaks.

@generated function drop_nothing_params(x::NamedTuple)
    vals = (:($p=x.$p) for p in fieldnames(x) if fieldtype(x, p) !== Nothing)
    return quote
        (;$(vals...))
    end
end
julia> include("mwe3.jl")
drop_nothing_params (generic function with 1 method)

julia> includet("mwe3.jl")
ERROR: UndefVarError: `#s2#15` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ ~/code/CedarSim.jl/mwe3.jl:1
in expression starting at /home/pepijn/code/CedarSim.jl/mwe3.jl:1

This also shows up in a larger project where using works fine, but if you change the file, it throws an error with a similar gensym symbol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions