Skip to content

Potentially too strict type argument bounds check #15609

Closed
@WojciechMazur

Description

@WojciechMazur

Community build regression for https://github.com/zio/zio (maintainer @jdegoes @adamgfraser)
Based on https://scala3.westeurope.cloudapp.azure.com/blue/organizations/jenkins/buildCommunityProject/detail/buildCommunityProject/843/pipeline/
Related change #15571

Compiler version

Works with 3.2.0-RC1
Fails with 3.2.1-RC1-bin-20220705-9bb3108-NIGHTLY

Minimized code

sealed trait ZIO[-R, +E, +A]
object ZIO {
  def uninterruptibleMask[R, E, A](f: Any => ZIO[R, E, A]): ZIO[R, E, A] = ???
}

final class ReleaseExit[-R, +E, E1, +A, B] {
  def apply[R1 <: R, E2 >: E <: E1, B1 <: B](use: A => ZIO[R1, E2, B1]): ZIO[R1, E2, B1] =
    ZIO.uninterruptibleMask[R1, E2, B1](restore => ???)
}

Output

[error] ./test.scala:8:33: type argument has potentially unrealizable bounds  >: E <: E1
[error]     ZIO.uninterruptibleMask[R1, E2, B1](restore => ???)
[error]                                 ^^
Error compiling project (Scala 3.2.1-RC1-bin-20220705-9bb3108-NIGHTLY, JVM)```

Expectation

Should compile

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions