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)