Skip to content

Commit

Permalink
Fix Revise issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Dec 12, 2024
1 parent 84f05b3 commit cf22b24
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Stipple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,12 @@ macro kwredef(expr)
if isa(T_old, Expr) && T_old.head == Symbol(".")
T_old = (split(string(T_old), '.')[end] |> Symbol)
end

t[n] = T_new = gensym(T_old)

# in the first run the datatype is not yet defined
# this is also the case when Revise registers the code, therefore we need
# to make sure that the generated name is always identical for first definition
called_first_time = !isa(T_old, DataType)
t[n] = T_new = called_first_time ? Symbol(T_old, :def) : gensym(T_old)

esc(quote
Base.@kwdef $expr
Expand Down

0 comments on commit cf22b24

Please sign in to comment.