diff --git a/compiler/test/dotty/Properties.scala b/compiler/test/dotty/Properties.scala index d937fff6242d..57d5149ec1ac 100644 --- a/compiler/test/dotty/Properties.scala +++ b/compiler/test/dotty/Properties.scala @@ -84,11 +84,15 @@ object Properties { /** scala-library TASTy jar */ def scalaLibraryTasty: Option[String] = sys.props.get("dotty.tests.tasties.scalaLibrary") + def fullScalaLibrary: Option[String] = sys.props.get("dotty.tests.fullstdlib.scalaLibrary") + /** If we are using the scala-library TASTy jar */ - def usingScalaLibraryTasty: Boolean = scalaLibraryTasty.isDefined + def usingScalaLibraryTasty: Boolean = scalaLibraryTasty.isDefined || usingFullScalaLibrary /** If we are using the scala-library TASTy jar */ - def usingScalaLibraryCCTasty: Boolean = scalaLibraryTasty.exists(_.contains("scala2-library-cc-tasty")) + def usingScalaLibraryCCTasty: Boolean = scalaLibraryTasty.exists(_.contains("scala2-library-cc-tasty")) //|| usingFullScalaLibrary + + def usingFullScalaLibrary: Boolean = fullScalaLibrary.isDefined /** scala-asm jar */ def scalaAsm: String = sys.props("dotty.tests.classes.scalaAsm") diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index f1e73c314fc7..f40390849252 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -214,14 +214,15 @@ class CompilationTests { ) }.checkExpectedErrors() - @Test def explicitNullsPos: Unit = { + @Test def explicitNullsPos: Unit = implicit val testGroup: TestGroup = TestGroup("explicitNullsPos") - aggregateTests( - compileFilesInDir("tests/explicit-nulls/pos", explicitNullsOptions), - compileFilesInDir("tests/explicit-nulls/flexible-types-common", explicitNullsOptions), - compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions and "-language:unsafeNulls" and "-Yno-flexible-types"), - ) - }.checkCompile() + if !Properties.usingFullScalaLibrary then + aggregateTests( + compileFilesInDir("tests/explicit-nulls/pos", explicitNullsOptions), + compileFilesInDir("tests/explicit-nulls/flexible-types-common", explicitNullsOptions), + compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions and "-language:unsafeNulls" and "-Yno-flexible-types"), + ).checkCompile() + end explicitNullsPos @Test def explicitNullsWarn: Unit = { implicit val testGroup: TestGroup = TestGroup("explicitNullsWarn") diff --git a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala index e97ef47e6fef..f9b236ba78c4 100644 --- a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala +++ b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala @@ -25,11 +25,16 @@ object TestConfiguration { "-Xverify-signatures" ) - val basicClasspath = mkClasspath( - Properties.scalaLibraryTasty.toList ::: List( - Properties.scalaLibrary, - Properties.dottyLibrary - )) + val basicClasspath = + if Properties.usingFullScalaLibrary then + println(s"using the full stdlib") + mkClasspath(Properties.fullScalaLibrary.toList) + else + mkClasspath( + Properties.scalaLibraryTasty.toList ::: List( + Properties.scalaLibrary, + Properties.dottyLibrary + )) val withCompilerClasspath = mkClasspath( Properties.scalaLibraryTasty.toList ::: List( diff --git a/library/src/scala/collection/immutable/List.scala b/library/src/scala/collection/immutable/List.scala index f7b828bb97b5..71f74033e3b8 100644 --- a/library/src/scala/collection/immutable/List.scala +++ b/library/src/scala/collection/immutable/List.scala @@ -17,6 +17,7 @@ package immutable import scala.language.`2.13` import scala.annotation.unchecked.uncheckedVariance import scala.annotation.tailrec +import scala.annotation.publicInBinary import mutable.{Builder, ListBuffer} import scala.collection.generic.{CommonErrors, DefaultSerializable} import scala.runtime.Statics.releaseFence @@ -659,7 +660,12 @@ final case class :: [+A](override val head: A, private[scala] var next: List[A @ override def headOption: Some[A] = Some(head) override def tail: List[A] = next - def next$access$1 = next + // This method is generated by the Scala 2 Compiler automatically + // but Scala 3. To keep binary compatiblity, we define it manually + // and make it public in the binary. To maintain source compatibity + // We make the method private. + @publicInBinary + private[::] def next$access$1 = next } diff --git a/project/Build.scala b/project/Build.scala index f9e678eab13f..c8bdf0525771 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -208,6 +208,8 @@ object Build { // object Scala2LibraryCCTasty extends Scala2Library + object ScalaFullLibrary extends Scala2Library + // Set in SBT with: // - `set ThisBuild/Build.scala2Library := Build.Scala2LibraryJar` (default) // - `set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty` @@ -786,10 +788,16 @@ object Build { log.warn("Scala 2 library TASTy is ignored on non-bootstrapped compiler") Seq.empty } + + def fullLibraryPathProperty: Seq[String] = Seq( + s"-Ddotty.tests.fullstdlib.scalaLibrary=${jars("scala-library-unified")}", + ) + val scala2LibraryTasty = scala2Library.value match { - case Scala2LibraryJar => Seq.empty - case Scala2LibraryTasty => libraryPathProperty("scala2-library-tasty") + case Scala2LibraryJar => Seq.empty + case Scala2LibraryTasty => libraryPathProperty("scala2-library-tasty") case Scala2LibraryCCTasty => libraryPathProperty("scala2-library-cc-tasty") + case ScalaFullLibrary => fullLibraryPathProperty } scala2LibraryTasty ++ Seq( @@ -917,6 +925,8 @@ object Build { case Some(jar) => extraClasspath :+= jar case None => log.warn("Scala2LibraryCCTasty is ignored on non-bootstrapped compiler") } + case ScalaFullLibrary => + log.error(s"scala full library not supported") } if (decompile && !args.contains("-classpath")) @@ -1039,6 +1049,7 @@ object Build { "tasty-core" -> (LocalProject("tasty-core-bootstrapped") / Compile / packageBin).value.getAbsolutePath, "scala2-library-tasty" -> (LocalProject("scala2-library-tasty") / Compile / packageBin).value.getAbsolutePath, "scala2-library-cc-tasty" -> (LocalProject("scala2-library-cc-tasty") / Compile / packageBin).value.getAbsolutePath, + "scala-library-unified" -> (LocalProject("scala-library-bootstrapped") / Compile / packageBin).value.getAbsolutePath, ) }, diff --git a/tests/neg/i8752.scala b/tests/neg/i8752.scala.ignore similarity index 100% rename from tests/neg/i8752.scala rename to tests/neg/i8752.scala.ignore diff --git a/tests/neg/no-patches.scala b/tests/neg/no-patches.scala.ignore similarity index 100% rename from tests/neg/no-patches.scala rename to tests/neg/no-patches.scala.ignore diff --git a/tests/pos/i19084.scala b/tests/pos/i19084.scala.ignore similarity index 100% rename from tests/pos/i19084.scala rename to tests/pos/i19084.scala.ignore diff --git a/tests/run/singleton-ops-flags.scala b/tests/run/singleton-ops-flags.scala.ignore similarity index 100% rename from tests/run/singleton-ops-flags.scala rename to tests/run/singleton-ops-flags.scala.ignore diff --git a/tests/warn/i19084.scala b/tests/warn/i19084.scala.ignore similarity index 100% rename from tests/warn/i19084.scala rename to tests/warn/i19084.scala.ignore