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

Require the Each keyword to flatMap to a collection type #513

Merged
merged 2 commits into from
Dec 11, 2021

Conversation

Atry
Copy link
Collaborator

@Atry Atry commented Dec 11, 2021

val y: Vector[Int] = {
  val x: Int = !Each(List(1, 2))
  Vector(x + 10) // Good
}
val y: Int = {
  val x: Int = !Each(List(1, 2))
  x + 10 // this previously compiles but it is invalid since this commit, because x + 10 is not a collection
}

``` scala
val y: Vector[Int] = {
  val x: Int = !Each(List(1, 2))
  Vector(x + 10) // Good
}
```

``` scala
val y: Int = {
  val x: Int = !Each(List(1, 2))
  x + 10 // this previously compiles but it is invalid since this commit, because x + 10 is not a collection
}
```
@Atry Atry merged commit ebc0d42 into ThoughtWorksInc:main Dec 11, 2021
@Atry Atry deleted the each-flatMap branch December 11, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant