Skip to content

actively remove the pickle annotations when "copying" the class files over from Scala 2 #24161

@unkarjedy

Description

@unkarjedy

Compiler version

3.8-* (whatever is the latest nightly

While looking into changes in Scala 3.8 library (SCL-24347) and investigating some exceptions in IntelliJ IDEA we noticed that:

In addition to TASTy in Tuple1.tasty, Tuple1.class contains Scala 2's "pickles"
(which is not the case for other .class files).

Here's the list of such classes (15 from 3643):

scala/AnyVal.class
scala/Tuple1.class
scala/Tuple2.class
scala/collection/DoubleStepper.class
scala/collection/IntStepper.class
scala/collection/LongStepper.class
scala/collection/immutable/DoubleVectorStepper.class
scala/collection/immutable/IntVectorStepper.class
scala/collection/immutable/LongVectorStepper.class
scala/collection/immutable/Range.class
scala/jdk/DoubleAccumulator.class
scala/jdk/IntAccumulator.class
scala/jdk/LongAccumulator.class
scala/runtime/NonLocalReturnControl.class
scala/util/Sorting.class

I think those are the ones copied from the Scala 2 library due to specialization issues

Some classes are copied directly from Scala 2.13 stdlid. See this file for the full list. It's not only specialized classess, but also the classes defining specialized methods as these would introduce additional bridges

private lazy val filesToCopy = Set(

scala/AnyVal.class is not on the explicit list, we might need to investigate this one
I guess this one was not generated at all by Scala 3 compiler so the Scala 2 variant was used
See https://github.com/scala/scala3/blob/0afa50da6128b04289c108bc54ecf338f3e3e115/library/src/scala/AnyVal.scala.ignore (

I think we should actively remove the pickle annotations when "copying" the class files over from Scala 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions