Closed russellremple closed 1 year ago
It will probably be a couple weeks before I can get around to reviewing this, but I am excited.
Nice to see extends AnyVal doesn't seem to be needed.
Is the REstore NV copyright still appropriate in the Scala3 version of the type conversions? It would appear you completely rewrote that file.
As an aside I'm looking at updating my build VM I use to publish from. I'm hoping to get back to this around the 11th, unfortunately I am going to mostly be kept from my keyboard until then but did manage to sneak some time today to read through most of the changes.
Nice to see extends AnyVal doesn't seem to be needed.
Is the REstore NV copyright still appropriate in the Scala3 version of the type conversions? It would appear you completely rewrote that file.
As an aside I'm looking at updating my build VM I use to publish from. I'm hoping to get back to this around the 11th, unfortunately I am going to mostly be kept from my keyboard until then but did manage to sneak some time today to read through most of the changes.
Thanks! You're right, that part is probably rewritten to the point the copyright isn't appropriate. I'll remove it.
I wasn't sure about your versioning/release strategy. Seems like you are trying to keep the versioning in sync with Guice versioning. If you want to keep the version number the same and just release a _3 artifact, that works for me. Or maybe you want a new patch version for all Scala versions, and bump the Guice version accordingly? I'm open to however you'd like it - just let me know on the 11th.
V5.1.1 should sync to Maven Central shortly.
Normally I would post the download statistics for the the various scala builds here, but SonaType seems to be b0rked and it throwing 500's ¯\_(ツ)_/¯.
Thought I'd take a swing at Scala 3?. This is my first PR here, so guidance is welcome.
The comment that "It seems it would probably require a macroized version of TypeConversions, assuming that is even possible." was exactly right. This PR introduces a new version of this component using the Scala 3 macro system. There are many parallels with the Scala 2 implementation, and they are structurally similar in terms of recursively deconstructing the type to build a
TypeLiteral
, but the details are quite different.It and the other 7 main and 3 test source files under
net.codingwell.scalaguice
that relied onTypeTag
were all moved to ascala-2
source directory without changes. Copies of these were created under ascala-3
source directory with the following small changes:TypeTag
references were removed entirely. (At first I thought I'd replace these withClassTag
references, but that turned out to be unnecessary.)typeLiteral
method) were all madeinline
to preserve the underlying structure of the type parameter.inline
(like class creation) were changed to have the neededTypeLiteral
constructed earlier and passed in as a parameter.ClassTag
resolution logic, addressing name clashesOther changes in support of this PR include:
ScalaModule
, I addressed the issue related to having AbstractModule as the self type (called out as a TODO related to extending Java interface with a value/method name clash - http://lampsvn.epfl.ch/trac/scala/ticket/3564), but I stopped short of doing the same in the Scala 2 version to minimize the potential impact of the change.There is a lot more code duplication here than I'd like, with the obvious downsides of that, but not sure how to avoid it. The upside is that your confidence that I have not messed up the Scala 2 artifacts should be very high.