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
Compiling
object Test extends Application { val l1 = List(1, "2") val l2 = for (i: Int <- l1) yield i+1 }
yields
Test.scala:3: error: type mismatch; found : (Int) => Int required: (Any) => ? val l2 = for (i: Int <- l1) yield i+1 ^ one error found
The method TypeBuilder.makeGenerator should transform the generator x: Int <- l1 to
TypeBuilder.makeGenerator
x: Int <- l1
x: Int <- l1.filter {case x: Int => true; case _ => false }
since pattern is not irrefutable for type Any (the list's element type).
Any
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-1089?orig=1 Reporter: @lrytz
Sorry, something went wrong.
@odersky said: Milestone postponed deleted
@paulp said: I am closing as a duplicate and consolidating under ticket #900. See also #1673.
No branches or pull requests
Compiling
yields
The method
TypeBuilder.makeGenerator
should transform the generatorx: Int <- l1
tosince pattern is not irrefutable for type
Any
(the list's element type).The text was updated successfully, but these errors were encountered: