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

Potentially too strict type argument bounds check #15609

Closed
WojciechMazur opened this issue Jul 7, 2022 · 2 comments · Fixed by #15577
Closed

Potentially too strict type argument bounds check #15609

WojciechMazur opened this issue Jul 7, 2022 · 2 comments · Fixed by #15577
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore stat:fix available
Milestone

Comments

@WojciechMazur
Copy link
Contributor

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

@WojciechMazur WojciechMazur added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 7, 2022
@smarter
Copy link
Member

smarter commented Jul 7, 2022

Related change #15571

This PR contains changes to the zio submodule which are undone in the currently open #15577 which would presumably also fix this issue.

@rochala rochala added stat:fix available area:typer regression This worked in a previous version but doesn't anymore and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 7, 2022
@SethTisue SethTisue changed the title Potentially to strict type argument bounds check Potentially too strict type argument bounds check Jul 7, 2022
@odersky
Copy link
Contributor

odersky commented Jul 8, 2022

We should merge #15577 quickly then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore stat:fix available
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants