From 39f7d95723ab6a7827877378033c09bfe1a1a1b4 Mon Sep 17 00:00:00 2001 From: Maxim Schuwalow Date: Sat, 27 Apr 2024 16:27:13 +0200 Subject: [PATCH] fix: instantiate new instance of phase for every plugin run in scala 3 --- .../src/main/scala-3/zio/profiling/plugins/TaggingPhase.scala | 2 +- .../src/main/scala-3/zio/profiling/plugins/TaggingPlugin.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPhase.scala b/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPhase.scala index d1a11ad..bb34c9a 100644 --- a/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPhase.scala +++ b/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPhase.scala @@ -15,7 +15,7 @@ import dotty.tools.dotc.core.Types.TypeRef import dotty.tools.dotc.ast.tpd.{TreeOps, Literal} import dotty.tools.dotc.ast.untpd.Mod.Given.apply -object TaggingPhase extends PluginPhase { +final class TaggingPhase extends PluginPhase { val phaseName = "zio-profiling-tagging" diff --git a/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPlugin.scala b/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPlugin.scala index 255542c..124999d 100644 --- a/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPlugin.scala +++ b/zio-profiling-tagging-plugin/src/main/scala-3/zio/profiling/plugins/TaggingPlugin.scala @@ -14,5 +14,5 @@ class TaggingPlugin extends StandardPlugin { val name: String = "zio-profiling-tagging" override val description: String = "automatically tag zio effects" - def init(options: List[String]): List[PluginPhase] = List(TaggingPhase) + def init(options: List[String]): List[PluginPhase] = List(new TaggingPhase()) }