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

Make direct tuple assignment work by default in 3.4 #18606

Closed
wants to merge 1 commit into from

Conversation

carlosedp
Copy link

@carlosedp carlosedp commented Sep 27, 2023

As described in https://contributors.scala-lang.org/t/make-tuple-unpack-feature-from-source-future-become-default/6238, this PR enables direct tuple assignment in for comprehensions on Scala 3.4.

  // With ZIO assignment separately:
  def y =
    for
      x <- ZIO.fromOption(Some(1, 2))
      (a, b) = x
    yield (a, b)

  println(runZIO(y))

  // With ZIO direct assignment (doesn't work unless using "-source:future"):
  def z =
    for
      (a, b) <- ZIO.fromOption(Some(1, 2))
    yield (a, b)

This behavior was available previously only thru -source:future and better-monadic-for lib.

I might need some guidance to change the test cases to address this.

Addresses #16334

@carlosedp
Copy link
Author

CLA signed

@bishabosha
Copy link
Member

this is already being done in #16665 admittedly its a bit out of date by now, but some community build projects were blocking

@bishabosha
Copy link
Member

im going to close this one in favour of #16665 which I just updated - it has fewer failures in the CI

@bishabosha bishabosha closed this Sep 28, 2023
@carlosedp
Copy link
Author

Following the PR over there. Thanks @bishabosha!

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.

2 participants