Motivation:
In Akka/Pekko there are some helper methods, if you marked it as inline def, it works very well in Scala 3, but will cause problem when call it from Java or old version where it was not marked inline def.
error] Test docs.javadsl.SqsPublishTest failed: java.lang.NoSuchMethodError: org.apache.pekko.util.FutureConverters$FutureOps$.asJava$extension(Lscala/concurrent/Future;)Ljava/util/concurrent/CompletionStage;, took 0.0 sec
[error] at org.apache.pekko.http.javadsl.Http.shutdownAllConnectionPools(Http.scala:798)
[error] at org.apache.pekko.stream.connectors.sqs.javadsl.BaseSqsTest.teardown(BaseSqsTest.java:62)
This does bring up questions about whether its valid to combine both inline keyword with @targetName which would avoid needing to create a new method that would never be directly called in Scala (as the previously mentioned PR has to do), i.e.
Thanks for the suggestion, we decided to revert the change and I don’t think the inheritence method would work in our case anyways since our implementation class extends AnyVal which disables any inheritance (iirc).
Im still wondering why the @targetName trick didn’t work, according to documentation it should have theoretically worked? You can look at the previously referenced PR but as far as I understand it should have created those original methods in the JVM bytecode which should have been picked up at runtime.
True, in our case we were using inline primarily because its getting rid of a cross compat wrapper class and also because it was a case of why not, i.e. free lunch