From 27bd97554cf486b44c15c68d52b3b33cfb5b84ca Mon Sep 17 00:00:00 2001 From: Florian3k Date: Mon, 1 Jul 2024 13:51:43 +0200 Subject: [PATCH 1/2] Add sources of synthetic classes to sources jar --- library-aux/src/scala/AnyKind.scala | 7 +++++++ library-aux/src/scala/Matchable.scala | 7 +++++++ library-aux/src/scala/andType.scala | 7 +++++++ library-aux/src/scala/orType.scala | 7 +++++++ project/Build.scala | 6 +++++- 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 library-aux/src/scala/AnyKind.scala create mode 100644 library-aux/src/scala/Matchable.scala create mode 100644 library-aux/src/scala/andType.scala create mode 100644 library-aux/src/scala/orType.scala diff --git a/library-aux/src/scala/AnyKind.scala b/library-aux/src/scala/AnyKind.scala new file mode 100644 index 000000000000..02c4d3747bcc --- /dev/null +++ b/library-aux/src/scala/AnyKind.scala @@ -0,0 +1,7 @@ +package scala + +/** The super-type of all types. + * + * See [[https://docs.scala-lang.org/scala3/reference/other-new-features/kind-polymorphism.html]]. + */ +final abstract class AnyKind diff --git a/library-aux/src/scala/Matchable.scala b/library-aux/src/scala/Matchable.scala new file mode 100644 index 000000000000..5cef77929417 --- /dev/null +++ b/library-aux/src/scala/Matchable.scala @@ -0,0 +1,7 @@ +package scala + +/** The base trait of types that can be safely pattern matched against. + * + * See [[https://docs.scala-lang.org/scala3/reference/other-new-features/matchable.html]]. + */ +trait Matchable diff --git a/library-aux/src/scala/andType.scala b/library-aux/src/scala/andType.scala new file mode 100644 index 000000000000..968cc2e9a8fa --- /dev/null +++ b/library-aux/src/scala/andType.scala @@ -0,0 +1,7 @@ +package scala + +/** The intersection of two types. + * + * See [[https://docs.scala-lang.org/scala3/reference/new-types/intersection-types.html]]. + */ +type &[A, B] = A & B diff --git a/library-aux/src/scala/orType.scala b/library-aux/src/scala/orType.scala new file mode 100644 index 000000000000..b6dc8ea2563c --- /dev/null +++ b/library-aux/src/scala/orType.scala @@ -0,0 +1,7 @@ +package scala + +/** The union of two types. + * + * See [[https://docs.scala-lang.org/scala3/reference/new-types/union-types.html]]. + */ +type |[A, B] = A | B diff --git a/project/Build.scala b/project/Build.scala index c1a8800421a6..fdda870703b3 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -987,7 +987,11 @@ object Build { "-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator), "-Yexplicit-nulls", ), - (Compile / doc / scalacOptions) ++= ScaladocConfigs.DefaultGenerationSettings.value.settings + (Compile / doc / scalacOptions) ++= ScaladocConfigs.DefaultGenerationSettings.value.settings, + (Compile / packageSrc / mappings) ++= { + val auxBase = (ThisBuild / baseDirectory).value / "library-aux/src" + auxBase ** "*.scala" pair io.Path.relativeTo(auxBase) + }, ) lazy val `scala3-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped) From 32b5843eee864d166ce78a1031504bc5429dd082 Mon Sep 17 00:00:00 2001 From: Florian3k Date: Wed, 3 Jul 2024 20:38:00 +0200 Subject: [PATCH 2/2] apply fixes from review --- library-aux/src/scala/AnyKind.scala | 2 +- library-aux/src/scala/Matchable.scala | 2 +- library-aux/src/scala/andType.scala | 4 ++-- library-aux/src/scala/orType.scala | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library-aux/src/scala/AnyKind.scala b/library-aux/src/scala/AnyKind.scala index 02c4d3747bcc..56d51be114ea 100644 --- a/library-aux/src/scala/AnyKind.scala +++ b/library-aux/src/scala/AnyKind.scala @@ -2,6 +2,6 @@ package scala /** The super-type of all types. * - * See [[https://docs.scala-lang.org/scala3/reference/other-new-features/kind-polymorphism.html]]. + * See [[https://docs.scala-lang.org/scala3/reference/other-new-features/kind-polymorphism.html]]. */ final abstract class AnyKind diff --git a/library-aux/src/scala/Matchable.scala b/library-aux/src/scala/Matchable.scala index 5cef77929417..598ded9d3bc3 100644 --- a/library-aux/src/scala/Matchable.scala +++ b/library-aux/src/scala/Matchable.scala @@ -2,6 +2,6 @@ package scala /** The base trait of types that can be safely pattern matched against. * - * See [[https://docs.scala-lang.org/scala3/reference/other-new-features/matchable.html]]. + * See [[https://docs.scala-lang.org/scala3/reference/other-new-features/matchable.html]]. */ trait Matchable diff --git a/library-aux/src/scala/andType.scala b/library-aux/src/scala/andType.scala index 968cc2e9a8fa..de3c3ff36bc5 100644 --- a/library-aux/src/scala/andType.scala +++ b/library-aux/src/scala/andType.scala @@ -2,6 +2,6 @@ package scala /** The intersection of two types. * - * See [[https://docs.scala-lang.org/scala3/reference/new-types/intersection-types.html]]. + * See [[https://docs.scala-lang.org/scala3/reference/new-types/intersection-types.html]]. */ -type &[A, B] = A & B +type &[A, B] diff --git a/library-aux/src/scala/orType.scala b/library-aux/src/scala/orType.scala index b6dc8ea2563c..ff1947a9498e 100644 --- a/library-aux/src/scala/orType.scala +++ b/library-aux/src/scala/orType.scala @@ -2,6 +2,6 @@ package scala /** The union of two types. * - * See [[https://docs.scala-lang.org/scala3/reference/new-types/union-types.html]]. + * See [[https://docs.scala-lang.org/scala3/reference/new-types/union-types.html]]. */ -type |[A, B] = A | B +type |[A, B]