So I found another issue when adding Scala 3 support to pekko-persistence-jdbc i.e. Add Scala 3 support by mdedetrich · Pull Request #44 · apache/incubator-pekko-persistence-jdbc · GitHub. This is in regards to Scala 3’s cyclic import detection. I have noticed this before and although in some cases there are workarounds i.e.
https://github.com/mdedetrich/incubator-pekko-persistence-jdbc/blob/8e9b0129fe448b3601db1386f3cbaabf499ebda6/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala#L50 complains with
[error] -- [E046] Cyclic Error: /Users/mdedetrich/github/incubator-pekko-persistence-jdbc/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateStore.scala:50:1
[error] 50 |@ApiMayChange
[error] | ^
[error] | Cyclic reference involving val <import>
[error] |
[error] | longer explanation available when compiling with `-explain`
And this can be fixed by just changing it to a FQCN import i.e.
@pekko.annotation.ApiMayChange
There is another case of E046 at https://github.com/mdedetrich/incubator-pekko-persistence-jdbc/blob/8e9b0129fe448b3601db1386f3cbaabf499ebda6/core/src/main/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/DurableStateSequenceActor.scala#L118 which I have no idea how to change (in fact it doesn’t look cyclic at all).
The current implementation of the cyclic import detection either seems to be brittle (in the case of `@ApiMayChange annotation, doesn’t seem like it can handle nesting well) or its a case of a spurious error due to other compilation problems (that branch isn’t fully compiling yet)?