Skip to content

Tasty Reader: Add support for Scala 3.2#10068

Merged
SethTisue merged 7 commits into
scala:2.13.xfrom
scalacenter:tasty/support-scala3.2
Jul 11, 2022
Merged

Tasty Reader: Add support for Scala 3.2#10068
SethTisue merged 7 commits into
scala:2.13.xfrom
scalacenter:tasty/support-scala3.2

Conversation

@bishabosha

@bishabosha bishabosha commented Jul 6, 2022

Copy link
Copy Markdown
Member

supports the tasty for Scala 3.2.0 (i.e. 28.2-0)

  • Added support for the new constructor encoding in TASTy.
  • Stops forcing Scala 3 methods in SpecializeTypes
  • Reduces how many annotations are forced so that problematic API's are not forced accidentally when the user never accesses them.

fixes scala/bug#12585

Note that the sequel PR #10127 updates this for Scala 3.2.0 final (and removes the exception for 3.2.0-RCx (28.2-1)).

@bishabosha
bishabosha requested review from SethTisue and dwijnand July 6, 2022 16:05
@scala-jenkins scala-jenkins added this to the 2.13.10 milestone Jul 6, 2022
@bishabosha bishabosha changed the title Tasty Reader support Scala 3.2 Tasty Reader support Scala 3.2 [ci: last-only] Jul 6, 2022
@bishabosha
bishabosha force-pushed the tasty/support-scala3.2 branch from d80c3d0 to 4988305 Compare July 6, 2022 16:07
@SethTisue SethTisue modified the milestones: 2.13.10, 2.13.9 Jul 6, 2022
@SethTisue SethTisue added the prio:blocker release blocker (used only by core team, only near release time) label Jul 6, 2022

@lrytz lrytz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, needs a rebase for Jenkins to pick it up.

Scala 3.2.0 adds the scala.deriving.Mirror.fromProductTyped
method to its stdlib. This method is forced by
SpecializeTypes which in turn causes a chain of forces, leading
to scala.Tuple being reached in an upper bound of
Mirror.ProductOf. This causes an error for any code reading an
enum/case-class/sealed-trait from Scala 3. So do not force any
scala 3 method in this phase, as Scala 3 does not support
specialisation.

Alternatives include further delaying when errors are reported
for problematic definitions, (i.e. do not throw TypeError),
but this appeared to have more strange knock-on effects.
this is because we can get away with not forcing most annotations.

Keep forcing scala.annotation.internal.Child.

so a problematic annotation will stay unforced unless the user uses
some macro to force all annotations on all methods.
@bishabosha
bishabosha force-pushed the tasty/support-scala3.2 branch from 4988305 to d7f0b8b Compare July 7, 2022 13:45
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Jul 11, 2022
@SethTisue
SethTisue merged commit aa579da into scala:2.13.x Jul 11, 2022
@SethTisue SethTisue removed the prio:blocker release blocker (used only by core team, only near release time) label Jul 11, 2022
@SethTisue SethTisue changed the title Tasty Reader support Scala 3.2 [ci: last-only] Tasty Reader: Add support for Scala 3.2 Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes worth highlighting in next release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support Scala 3.2.0 in TASTy Reader

5 participants