Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions compiler/test/dotty/Properties.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
15 changes: 8 additions & 7 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
15 changes: 10 additions & 5 deletions compiler/test/dotty/tools/vulpix/TestConfiguration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 7 additions & 1 deletion library/src/scala/collection/immutable/List.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

}

Expand Down
15 changes: 13 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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,
)
},

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading