From cf22b248f934cd0b1d0ccb01603dcb21f39569d6 Mon Sep 17 00:00:00 2001 From: hhaensel Date: Thu, 12 Dec 2024 19:54:05 +0100 Subject: [PATCH] Fix Revise issue --- src/Stipple.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Stipple.jl b/src/Stipple.jl index d86a0eb..4c4387f 100644 --- a/src/Stipple.jl +++ b/src/Stipple.jl @@ -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