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
infer simpler type for existentials #5579
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5579?orig=1 |
@soc said: <console>:12: error: no type parameters for method apply: (f: Int => Result[A])Apply[A] in object Apply exist so that it can be applied to arguments (Int => Success[_ >: Some[Int] with None.type <: Option[Int]])
--- because ---
argument expression's type is not compatible with formal parameter type;
found : Int => Success[_ >: Some[Int] with None.type <: Option[Int]]
required: Int => Result[?A]
def goo : Apply[Option[Int]] = Apply { i =>
^
<console>:12: error: type mismatch;
found : Int => Success[_ >: Some[Int] with None.type <: Option[Int]]
required: Int => Result[A]
def goo : Apply[Option[Int]] = Apply { i =>
^
<console>:12: error: type mismatch;
found : Apply[A]
required: Apply[Option[Int]]
def goo : Apply[Option[Int]] = Apply { i =>
^ |
@phaller said: |
"probably it's not a bug" — closing unless/until someone steps forward and says they're pretty sure it is, with evidence |
It's a bug - the example compiles in Dotty (modulo the explicit existential of course). The cause is the same as #10519 - unrelatable skolem doesn't contribute to the constraints of the type variable. |
by existentially abstracting them. Adds a necessary boolean flag to `existentialAbstraction` to flip the variance for upper bounds which need to be minimized. Fixes scala/bug#5559, fixes scala/bug#5579 and fixes scala/bug#10519
by existentially abstracting them. Adds a necessary boolean flag to `existentialAbstraction` to flip the variance for upper bounds which need to be minimized. Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519 and fixes scala/bug#10771
by existentially abstracting them. Adds a necessary boolean flag to `existentialAbstraction` to flip the variance for upper bounds which need to be minimized. Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519 and fixes scala/bug#10771
by existentially abstracting them. Adds a necessary boolean flag to `existentialAbstraction` to flip the variance for upper bounds which need to be minimized. Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519 and fixes scala/bug#10771
by existentially abstracting them. Adds a necessary boolean flag to `existentialAbstraction` to flip the variance for upper bounds which need to be minimized. Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519 and fixes scala/bug#10771
Probably it's not a bug, however looks very suspicious
The text was updated successfully, but these errors were encountered: