jypma opened a new issue, #3474:
URL: https://github.com/apache/pekko/issues/3474

   I'm trying to create a "classic" persistent actor from Java:
   ```java
   public class TestActor extends AbstractPersistentActorWithTimers {
     // stub implementations for all methods
   }
   ```
   while depending on Pekko 1.7.0 in my pom:
   ```xml
     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>3.13.0</version>
           <configuration>
             <release>21</release>
           </configuration>
         </plugin>
       </plugins>
     </build>
   
     <dependencies>
       <dependency>
         <groupId>org.apache.pekko</groupId>
         <artifactId>pekko-persistence_3</artifactId>
         <version>1.7.0</version>
       </dependency>
     </dependencies>
   ```
   
   However, the Java compiler doesn't seem to like the way Scala 3 linearizes 
the traits that the Scala base class implements:
   ```
   TestActor.java:[5,8] types org.apache.pekko.actor.Timers and 
org.apache.pekko.persistence.Eventsourced are incompatible;
   [ERROR]   class com.predicti.config.TestActor inherits unrelated defaults 
for aroundPreRestart(java.lang.Throwable,scala.Option<java.lang.Object>) from 
types org.apache.pekko.actor.Timers and 
org.apache.pekko.persistence.Eventsourced
   ```
   
   I tried with Java versions 11 to 25, and pekko from 1.7.0 down to 1.1.4, 
with the same compile error.
   
   If I switch the scala binary version from 3 to 2.12, all pekko versions 
compile fine. So it's definitely Scala 3 related. What I don't know, is if this 
limitation is on purpose, or accidental :-) 
   
   Any thoughts on this? There might be other multi-trait base classes hiding 
in the code, that are not reachable from Java anymore since Scala 3.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to