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

Update core-tests, zio to 1.0.0-RC12 #50

Merged
merged 7 commits into from
Sep 3, 2019

Conversation

scala-steward
Copy link
Contributor

Updates

from 1.0.0-RC11-1 to 1.0.0-RC12.

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention @scala-steward in the comments below.

Have a fantastic day writing Scala!

Ignore future updates

Add this to your .scala-steward.conf file to ignore future updates of this dependency:

updates.ignore = [ { groupId = "dev.zio" } ]

labels: semver-pre-release

@ghostdogpr
Copy link
Member

ghostdogpr commented Sep 3, 2019

Fixed deprecation errors.

Seems ZIO Test wasn't released for 2.12 because of a scaladoc issue, will have to re-release it.

@ghostdogpr
Copy link
Member

I removed the dependency on core-tests since it was creating linking errors with ScalaJS and it was actually not used anywhere.

@neko-kai @mijicd ready for your review

neko-kai
neko-kai previously approved these changes Sep 3, 2019
@@ -421,7 +421,7 @@ object Schedule {
* @see zio.ZSchedule.succeedLazy
*/
final def succeedLazy[F[+_], A](a: => A): Schedule[F, Any, A] =
new Schedule(ZSchedule.succeedLazy(a))
new Schedule(ZSchedule.succeed(a))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this function should be

  1. implemented as forever.as(a) to preserve previous laziness
  2. deprecated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, succeed is already lazy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it will evaluate on call - https://github.com/zio/zio/blob/master/core/shared/src/main/scala/zio/ZSchedule.scala#L727 - although it's not important now if even zio-core's succeedLazy is now also strict anyway

@@ -124,7 +124,7 @@ private class CatsZManagedMonad[R, E] extends Monad[ZManaged[R, E, ?]] {
override def flatMap[A, B](fa: ZManaged[R, E, A])(f: A => ZManaged[R, E, B]): ZManaged[R, E, B] = fa.flatMap(f)

override def tailRecM[A, B](a: A)(f: A => ZManaged[R, E, Either[A, B]]): ZManaged[R, E, B] =
ZManaged.succeedLazy(f(a)).flatMap(identity).flatMap {
ZManaged.effectTotal(f(a)).flatMap(identity).flatMap {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests should now pass with ZManaged.suspend instead of this construct. Could you please check?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I’ll try

@@ -220,7 +220,7 @@ object STM {
final def succeed[F[+_], A](a: A): STM[F, A] = new STM(ZSTM.succeed(a))

final def succeedLazy[F[+_], A](a: => A): STM[F, A] =
new STM(ZSTM.succeedLazy(a))
new STM(ZSTM.succeed(a))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ought to deprecate AND preserve laziness with ZSTM.unit.as(a)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually succeed is already lazy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err, no, a is not by-name, it will evaluate a when applied, not when evaluated. https://github.com/zio/zio/blob/master/core/shared/src/main/scala/zio/stm/STM.scala#L766
You could say that ZSchedule.succeedLazy is already strict because it immediately evaluates when calling succeed (a change in this PR that went unnoticed zio/zio#1377). Actually, I think just putting a deprecation here should be enough (you can call deprecated methods inside deprecated methods without a warning AFAIK)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my bad. OK I'll keep calling the deprecated one since this one is deprecated.

@ghostdogpr
Copy link
Member

I think I should fix STM#die at least because it's not deprecated, the rest shouldn't matter.

@ghostdogpr
Copy link
Member

Ah actually the original STM#die is doing the same thing so I guess we're good?

@neko-kai
Copy link
Member

neko-kai commented Sep 3, 2019

👍

@ghostdogpr ghostdogpr merged commit d4ce92b into zio:master Sep 3, 2019
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

3 participants