From 95bd466a7811a1f2299aa7808b67d35cba3fca68 Mon Sep 17 00:00:00 2001 From: Florian3k Date: Mon, 1 Jul 2024 13:51:43 +0200 Subject: [PATCH] Add sources of synthetic classes to sources jar [Cherry-picked 27bd97554cf486b44c15c68d52b3b33cfb5b84ca] --- 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 8cb6cd5f736b..4a7ace79a623 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -879,7 +879,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)