bug icon indicating copy to clipboard operation
bug copied to clipboard

publish bootstrapping sources from `library-aux` in `-sources.jar` artefacts

Open unkarjedy opened this issue 1 year ago • 2 comments

This is needed to show documentation of definitions inside those classes inside IDE. See https://youtrack.jetbrains.com/issue/SCL-22167 (with comments)

The sources are located here: https://github.com/scala/scala/tree/2.13.x/src/library-aux

It's already done for scala docs—they are published in -javadoc.jar artifacts.

unkarjedy avatar Feb 23 '24 08:02 unkarjedy

@lrytz did we want to try to squeeze this into 2.13.14?

SethTisue avatar Mar 13 '24 11:03 SethTisue

👍

lrytz avatar Mar 13 '24 12:03 lrytz

BTW, can anyone tell why these source files are special that they are located in a separate library-aux directory? How e.g. Unit is different? Also, why do Unit, AnyRef, Int have .class files but Any and Singleton do not?

unkarjedy avatar Apr 02 '24 13:04 unkarjedy

I guess Int and the others can be represented precisely (enough) in Scala source so that the compiler can build its symbols and types from source. The backend of course intercepts primitives to emit them accordingly.

Trying to do the same with Nothing / Any / ... would need more magic in the compiler, I assume it was easier to create these symbols synthetically (https://github.com/scala/scala/blob/v2.13.13/src/reflect/scala/reflect/internal/Definitions.scala#L337-L354).

lrytz avatar Apr 02 '24 13:04 lrytz

Similar Scala 3 ticket: https://github.com/scala/scala3/issues/20073

unkarjedy avatar Apr 02 '24 16:04 unkarjedy