We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Type inferred inside for-comprehension is a union Any | X where X is expected
Any | X
X
3.1.2 Works with 3.1.1 Fails in 3.1.3-RC3 Fails in 3.2.0-RC1-bin-20220517-e5abec0-NIGHTLY
Based on https://github.com/vigoo/clipp/blob/8def1b439039fc8ddc74f55d8f58a337d11f919c/clipp-core/src/test/scala/io/github/vigoo/clipp/UsageInfoSpecs.scala#L94-L108
//> using scala "3.1.2" // //> using scala "3.1.1" // Last working stable version sealed abstract class Free[S[_], A] { final def map[B](f: A => B): Free[S, B] = ??? final def flatMap[B](f: A => Free[S, B]): Free[S, B] = new Free[S, B] {} } trait Parameter[T] def namedDouble(name: String): Free[Parameter, Double] = ??? type Double2 = (Double, Double) type Double3 = (Double, Double, Double) val spec: Free[Parameter, Either[Double3, Double2]] = for { result <- if (???) { for { x <- namedDouble("X") y <- namedDouble("Y") z <- namedDouble("Z") } yield Left((x, y, z)) } else { for { x <- namedDouble("X") y <- namedDouble("Y") } yield Right((x, y)) } } yield result
[error] ./test.scala:28:9: Found: (result : Either[Any | (Double, Double, Double), (Double, Double) | Any]) [error] Required: Either[Double3, Double2] [error] } yield result [error] ^^^^^^
The text was updated successfully, but these errors were encountered:
First bad commit is 3ab18a9
Sorry, something went wrong.
Might be a duplicate of #14494
smarter
Successfully merging a pull request may close this issue.
Type inferred inside for-comprehension is a union
Any | X
whereX
is expectedCompiler version
3.1.2
Works with 3.1.1
Fails in 3.1.3-RC3
Fails in 3.2.0-RC1-bin-20220517-e5abec0-NIGHTLY
Minimized code
Based on https://github.com/vigoo/clipp/blob/8def1b439039fc8ddc74f55d8f58a337d11f919c/clipp-core/src/test/scala/io/github/vigoo/clipp/UsageInfoSpecs.scala#L94-L108
Output
Expectation
The text was updated successfully, but these errors were encountered: