diff --git a/core/src/main/scala/magnolia1/magnolia.scala b/core/src/main/scala/magnolia1/magnolia.scala index e60d1409..b0e33c07 100644 --- a/core/src/main/scala/magnolia1/magnolia.scala +++ b/core/src/main/scala/magnolia1/magnolia.scala @@ -903,8 +903,8 @@ private[magnolia1] object CompileTimeState { val depth = c.enclosingMacros.count(m => workSet(m.macroApplication.symbol)) try fn(stack.asInstanceOf[Stack[c.type]], depth) finally if (depth <= 1) { - stack.clear() - workSet.clear() + threadLocalStack.remove() + threadLocalWorkSet.remove() } } }