Skip to content
New issue

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

FutureConverters fails for MinimalStage #12918

Closed
lrytz opened this issue Nov 30, 2023 · 0 comments · Fixed by scala/scala#10615
Closed

FutureConverters fails for MinimalStage #12918

lrytz opened this issue Nov 30, 2023 · 0 comments · Fixed by scala/scala#10615
Assignees
Milestone

Comments

@lrytz
Copy link
Member

lrytz commented Nov 30, 2023

Reported by @nmarton-da (https://github.com/scala/scala/pull/10181/files#r1385648137)

scala> import scala.jdk.FutureConverters._
import scala.jdk.FutureConverters._

scala> import java.util.concurrent.CompletableFuture
import java.util.concurrent.CompletableFuture

scala> CompletableFuture.completedStage(42).asScala
java.lang.UnsupportedOperationException
  at java.base/java.util.concurrent.CompletableFuture$MinimalStage.isDone(CompletableFuture.java:2976)
  at scala.jdk.javaapi.FutureConverters$.asScala(FutureConverters.scala:73)
  at scala.jdk.FutureConverters$CompletionStageOps$.asScala$extension(FutureConverters.scala:41)
  ... 30 elided

JDK 11 has MinimalStage which is a CompletableFuture (also CompletionStage), with UnsupportedOperationException in lot of method bodies (like isDone). Regressed in scala/scala#10181.

See also Kotlin/kotlinx.coroutines#2456, playframework/playframework#11991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants