We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Based on Open CB failure for apache/incubator-pekko - build logs
Since 3.4.0-RC1-bin-20231113-0dfe593-NIGHTLY
Bisect points to a196167
import java.util.concurrent.CompletionStage import scala.concurrent.Future trait ActorRef[-T]{ def ask[Res](replyTo: ActorRef[Res] => T): Future[Res] = ??? } implicit final class FutureOps[T](private val f: Future[T]) extends AnyVal { def asJava: CompletionStage[T] = ??? } class AskPattern[Req, Res] { val actor: ActorRef[Req] = ??? val messageFactory: ActorRef[Res] => Req = ??? def failing(): CompletionStage[Res] = actor.ask(messageFactory.apply).asJava def workaround1(): CompletionStage[Res] = actor.ask[Res](messageFactory.apply).asJava def workaround2(): CompletionStage[Res] = actor.ask(messageFactory).asJava val jMessageFactory: java.util.function.Function[ActorRef[Res], Req] = ??? def originalFailingCase(): CompletionStage[Res] = actor.ask(jMessageFactory.apply).asJava }
-- [E007] Type Mismatch Error: /Users/wmazur/projects/dotty/bisect/main.scala:18:72 18 | def failing(): CompletionStage[Res] = actor.ask(messageFactory.apply).asJava | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | Found: java.util.concurrent.CompletionStage[Any] | Required: java.util.concurrent.CompletionStage[Res] | | longer explanation available when compiling with `-explain` -- [E007] Type Mismatch Error: /Users/wmazur/projects/dotty/bisect/main.scala:23:84 23 | def originalFailingCase(): CompletionStage[Res] = actor.ask(messageFactory.apply).asJava | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | Found: java.util.concurrent.CompletionStage[Any] | Required: java.util.concurrent.CompletionStage[Res] |
Should compile
The text was updated successfully, but these errors were encountered:
Another reproduction of code that started to fail since the same commit
import scala.util.{Try, Success, Failure} trait ActorRef[-T] trait ActorContext[T] { def ask[Req, Res](target: ActorRef[Req], createRequest: ActorRef[Res] => Req)( mapResponse: Try[Res] => T ): Unit } @main def Test = val context: ActorContext[Int] = ??? val askMeRef: ActorRef[Request] = ??? case class Request(replyTo: ActorRef[Int]) context.ask(askMeRef, Request.apply) { case Success(res) => res // error: expected Int, got Any case Failure(ex) => throw ex }
Sorry, something went wrong.
Yet another minimisation based on creativescala/doodle Open CB logs
trait IO[A]: def map[B](f: A => B): IO[B] = ??? trait RenderResult[T]: def value: T def IOasync[T](f: (Either[Throwable, T] => Unit) => Unit): IO[T] = ??? def render[T]: IO[T] = { def register(cb: Either[Throwable, RenderResult[T]] => Unit): Unit = ??? IOasync(register).map(_.value) // map should take RenderResult[T], but uses Any }
yields:
[error] ./main.scala:11:25 [error] value value is not a member of Any [error] IOasync(register).map(_.value) [error]
dwijnand
Successfully merging a pull request may close this issue.
Based on Open CB failure for apache/incubator-pekko - build logs
Compiler version
Since 3.4.0-RC1-bin-20231113-0dfe593-NIGHTLY
Bisect points to a196167
Minimized code
Output
Expectation
Should compile
The text was updated successfully, but these errors were encountered: