Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@scalavision
Copy link
Contributor

This is dependent on izumi-reflect:

zio/izumi-reflect#118

@adamgfraser
Copy link
Contributor

@scalavision Are you able to update this now that a new version of izumi-reflect has been published so we can get this in and do another ZIO release?

@scalavision scalavision changed the title WIP: update to scala 3.0.0-M3 update to scala 3.0.0-M3 Jan 8, 2021
@scalavision
Copy link
Contributor Author

scalavision commented Jan 8, 2021

I think this should work, the izumi-reflect version is correctly set at version M12. Do you want me to rebase against master, or are there other changes just let me know, I can work on it tomorrow, as it is getting a bit late here now :-)

When trying to test:compile at version 3.0.0-M3, I also get this strange error:

error] ../benchmarks/src/main/scala/zio/IOBenchmarks.scala:10:29: not found: type BootstrapRuntime
[error] object IOBenchmarks extends BootstrapRuntime {

I wonder if this is the dotty build not being able to propagate dependencies correctly. I have used both zio and zio-streams a bit locally without any problems, but there are a lot of bugs in the Scala 3 compiler still, so I don't think one can rely on everything here yet.

@adamgfraser
Copy link
Contributor

Doesn't look like there are any merge conflicts currently so don't think you need to rebase so couldn't hurt. Don't really know what to make of that error.

@scalavision scalavision force-pushed the upgrade-scala-3.0.0-M3 branch from c8f564a to 094950f Compare January 9, 2021 13:45
@scalavision
Copy link
Contributor Author

I've renamed to effect @adamgfraser , hehe the obvious choice of course! I am working on minimizing the issue with the scala 3 compiler. I think it is related to another problem I have encountered before. Will file an issue there when it gets ready.

@scalavision
Copy link
Contributor Author

I have added a bug report with a minimal example here in Dotty:

scala/scala3#11044

@scalavision scalavision force-pushed the upgrade-scala-3.0.0-M3 branch from 094950f to 943ea05 Compare January 11, 2021 18:34
@scalavision
Copy link
Contributor Author

@adamgfraser , could you take a look again, is there anything else that needs change? It seemed to be a red flag on the ci test for dotty_jdk8, but I wasn't able to see what was wrong.

The problem with shadowing of package name turned out to be well defined behavior according to the scala specification. I renamed the arg in def force function of ZIO.scala back from effect to zio, using _root_ as a prefix on the package name:

Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

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

@scalavision I think this is fine for now but I do still think there is a potential issue with force.

You're right that the definition of zio in the argument to force shadows the definition of the zio package object, so we shouldn't be able to refer to zio.InterruptStatus without qualifying it using _root_. However, we're not doing that but just trying to refer to InterruptStatus directly, which should already be in scope. This worked on all versions of Scala 2 as well as all versions of Scala 3 before this so unless there has been some discussion about how this is an intentional change I think it is worth at least raising the issue.

Do you want to do so? I am happy to as well.

@adamgfraser adamgfraser merged commit abc49a5 into zio:master Jan 11, 2021
@scalavision
Copy link
Contributor Author

just go ahead @adamgfraser :-) I think I understand what you mean, and it surprised me that the compiler didn't automatically search across all available namespaces in scope (as I would describe it). I also agree, it was surprising that this suddenly should break. However, I feel I don't have the deep knowledge into the compiler semantics that I can raise this issue in a convincing way.

Anyways, thanks for all the help getting this merged! I am really looking forward to the next release of this amazing library :-)

@adamgfraser
Copy link
Contributor

@scalavision Okay, will do and copy you. Thanks for your work on this! I know there are a lot of people who are eager to get a release for the latest version of Scala 3.

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