bug icon indicating copy to clipboard operation
bug copied to clipboard

support Scala 3.2.0 in TASTy Reader

Open bishabosha opened this issue 3 years ago • 14 comments

It will have a new tasty minor version so will be rejected by nsc.

bishabosha avatar Apr 26 '22 08:04 bishabosha

@bishabosha is there time to get this into 2.13.9? (tentative RC date is Mon May 9)

SethTisue avatar Apr 26 '22 14:04 SethTisue

The first 3.2.0-RC1 is scheduled for May 17th, the final 3.2.0 stable could be a few months from now so perhaps it should be released in 2.13.10?

bishabosha avatar Apr 26 '22 14:04 bishabosha

hmm... the timing is a bit awkward. @lrytz wdyt, does this incline you to delay 2.13.9 to get this in?

(leaving on 2.13.9 milestone for now, until we decide)

SethTisue avatar Apr 26 '22 14:04 SethTisue

Are there any changes in tasty so far, or is it only the version number check that fails? Are any (more) changes planned or likely to happen? Are changes to tasty always breaking, or are they / could they be benign in that an old 2.13 compiler could safely work with a new tasty?

lrytz avatar Apr 26 '22 20:04 lrytz

Are there any changes in tasty so far

extension methods will have a new encoding (should not affect scala 2), there will also be a change to the way constructors can be encoded (implications for annotations). A few other things affect only bodies of methods.

is it only the version number check that fails?

not if someone uses an annotation with the new constructor encoding.

Are any (more) changes planned or likely to happen?

not immediately, maybe the erasure of union types. (Int | Nothing)

Are changes to tasty always breaking, or are they / could they be benign in that an old 2.13 compiler could safely work with a new tasty?

some may be ok, but not when they affect either erasure, annotations, flags, or the byte format itself.

bishabosha avatar Apr 27 '22 13:04 bishabosha

suppose we waited for 3.2.0-RC1, then released 2.13.9. would that have a reasonably good chance of being a sufficient amount of waiting?

waiting until May 17 is only a short delay, but waiting 6 more weeks after that is a considerable delay.

SethTisue avatar May 02 '22 19:05 SethTisue

We discussed this at the Scala 2 team meeting yesterday, and we were all most comfortable with delaying 2.13.9 until after 3.2.0 final is out, rather than take any risks in this area.

SethTisue avatar May 03 '22 17:05 SethTisue

TODO: support erasure of Int | Nothing https://github.com/lampepfl/dotty/pull/14971 - probably no action to take here as we reject unions currently.

bishabosha avatar May 04 '22 10:05 bishabosha

also test against: https://github.com/lampepfl/dotty/pull/14840

bishabosha avatar May 11 '22 10:05 bishabosha

@bishabosha now that 3.2.0-RC1 is out, is it time to address this?

to be clear: 2.13.9 would still wait for 3.2.0 final. but we should verify ahead of time that we'll be ready, yes?

SethTisue avatar Jun 30 '22 17:06 SethTisue

yes I will start testing tomorrow

bishabosha avatar Jun 30 '22 17:06 bishabosha

@SethTisue I have hit a curious case that affects any time some sort of enum/case-class from Scala 3 is referenced.

  • SpecializeTypes phase forces every symbol in existence, which unfortunately then forces scala.deriving.Mirror.fromProductTyped, (new API in 3.2)
  • This sets of a chain of forcing scala.deriving.Mirror.ProductOf which then sees the upper bounds of MirroredElemTypes <: scala.Tuple and tasty unpickler panics that it can't support that (due to erasure issues) - will need to rethink how to be more lazy here.

Im thinking I should do it by instead of throwing an error - I should try an set a compiletimeOnly annotation on the closest enclosing public definition - the only problem is containing knock on errors when we can't meaningfully use the problematic type

bishabosha avatar Jul 01 '22 14:07 bishabosha

@bishabosha will we need one more PR after 3.2.0 final is out? if so, we should leave the ticket open

SethTisue avatar Jul 11 '22 18:07 SethTisue

Ok sure, I will remove the TASTy special case for 3.2.0 final, however it would not be necessary

bishabosha avatar Jul 12 '22 07:07 bishabosha

@bishabosha 3.2.0 is on Maven Central; can you submit the PR now?

SethTisue avatar Aug 31 '22 14:08 SethTisue

Ill do that now

bishabosha avatar Sep 01 '22 13:09 bishabosha