diff --git a/compiler/src/dotty/tools/dotc/Bench.scala b/compiler/src/dotty/tools/dotc/Bench.scala index 927b638f77dc..892c683181d8 100644 --- a/compiler/src/dotty/tools/dotc/Bench.scala +++ b/compiler/src/dotty/tools/dotc/Bench.scala @@ -4,6 +4,8 @@ package dotc import core.Contexts.Context import reporting.Reporter +import scala.annotation.internal.sharable + /** A main class for running compiler benchmarks. Can instantiate a given * number of compilers and run each (sequentially) a given number of times * on the same sources. diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 94304f5d90aa..3b27999cad35 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -13,6 +13,8 @@ import collection.mutable.ListBuffer import reporting.diagnostic.messages._ import reporting.trace +import scala.annotation.internal.sharable + object desugar { import untpd._ import DesugarEnums._ diff --git a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala index ebb3157a5733..77fe8dd97379 100644 --- a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala +++ b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala @@ -10,6 +10,8 @@ import collection.mutable.ListBuffer import util.Property import typer.ErrorReporting._ +import scala.annotation.internal.sharable + /** Helper methods to desugar enums */ object DesugarEnums { import untpd._ diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index 1213661673b2..0f512627a4d4 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -14,6 +14,7 @@ import parsing.Tokens.Token import printing.Printer import util.{Stats, Attachment, Property, DotClass} import config.Config +import annotation.internal.sharable import annotation.unchecked.uncheckedVariance import language.implicitConversions diff --git a/compiler/src/dotty/tools/dotc/ast/untpd.scala b/compiler/src/dotty/tools/dotc/ast/untpd.scala index b663a827679c..878d307dcd66 100644 --- a/compiler/src/dotty/tools/dotc/ast/untpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/untpd.scala @@ -11,6 +11,8 @@ import language.higherKinds import collection.mutable.ListBuffer import reflect.ClassTag +import scala.annotation.internal.sharable + object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo { // ----- Tree cases that exist in untyped form only ------------------ diff --git a/compiler/src/dotty/tools/dotc/config/CommandLineParser.scala b/compiler/src/dotty/tools/dotc/config/CommandLineParser.scala index 2298b8b209cb..c8304010e1b1 100644 --- a/compiler/src/dotty/tools/dotc/config/CommandLineParser.scala +++ b/compiler/src/dotty/tools/dotc/config/CommandLineParser.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc package config import scala.annotation.tailrec -import dotty.tools.sharable +import scala.annotation.internal.sharable /** A simple (overly so) command line parser. * !!! This needs a thorough test suite to make sure quoting is diff --git a/compiler/src/dotty/tools/dotc/config/Properties.scala b/compiler/src/dotty/tools/dotc/config/Properties.scala index efd7274f7a3e..9122272d588e 100644 --- a/compiler/src/dotty/tools/dotc/config/Properties.scala +++ b/compiler/src/dotty/tools/dotc/config/Properties.scala @@ -2,6 +2,8 @@ package dotty.tools package dotc package config +import scala.annotation.internal.sharable + import java.io.{ IOException, PrintWriter } import java.util.jar.Attributes.{ Name => AttributeName } diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 7fb8b9b79863..313806ef880d 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -94,6 +94,8 @@ class ScalaSettings extends Settings.SettingGroup { val YlogClasspath = BooleanSetting("-Ylog-classpath", "Output information about what classpath is being applied.") val YdisableFlatCpCaching = BooleanSetting("-YdisableFlatCpCaching", "Do not cache flat classpath representation of classpath elements from jars across compiler instances.") + val Yscala2Unpickler = StringSetting("-Yscala2-unpickler", "", "Control where we may get Scala 2 symbols from. This is either \"always\", \"never\", or a classpath.", "always") + val YnoImports = BooleanSetting("-Yno-imports", "Compile without importing scala.*, java.lang.*, or Predef.") val YnoInline = BooleanSetting("-Yno-inline", "Suppress inlining.") val YnoGenericSig = BooleanSetting("-Yno-generic-signatures", "Suppress generation of generic signatures for Java.") diff --git a/compiler/src/dotty/tools/dotc/config/ScalaVersion.scala b/compiler/src/dotty/tools/dotc/config/ScalaVersion.scala index 02ba74af97c0..9bb7431d5384 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaVersion.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaVersion.scala @@ -3,6 +3,7 @@ package dotty.tools package dotc.config +import scala.annotation.internal.sharable import scala.util.{Try, Success, Failure} /** diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index 18d7ea10e061..cb3272a3cdb3 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -29,6 +29,8 @@ import collection.immutable.BitSet import printing._ import config.{JavaPlatform, Platform, ScalaSettings, Settings} +import scala.annotation.internal.sharable + import language.implicitConversions import DenotTransformers.DenotTransformer import dotty.tools.dotc.profile.Profiler diff --git a/compiler/src/dotty/tools/dotc/core/NameKinds.scala b/compiler/src/dotty/tools/dotc/core/NameKinds.scala index 4e1494f28ed8..5920b6b29af0 100644 --- a/compiler/src/dotty/tools/dotc/core/NameKinds.scala +++ b/compiler/src/dotty/tools/dotc/core/NameKinds.scala @@ -11,6 +11,8 @@ import Decorators._ import Contexts.Context import collection.mutable +import scala.annotation.internal.sharable + /** Defines possible kinds of NameInfo of a derived name */ object NameKinds { diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index 1c2af332f8eb..fc1774cfd4a9 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -16,6 +16,8 @@ import util.{DotClass} import config.Config import java.util.HashMap +import scala.annotation.internal.sharable + object Names { import NameKinds._ diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index f64980e6c9a2..7672c055e4ba 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -24,6 +24,8 @@ import reporting.diagnostic.Message import reporting.diagnostic.messages.BadSymbolicReference import reporting.trace +import scala.annotation.internal.sharable + trait SymDenotations { this: Context => import SymDenotations._ diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index f00ca26f215e..271215777c04 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -31,6 +31,7 @@ import io.AbstractFile import language.implicitConversions import util.{NoSource, DotClass, Property} import scala.collection.JavaConverters._ +import scala.annotation.internal.sharable import config.Printers.typr /** Creation methods for symbols */ diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index ce039351201f..af13b3f22ed5 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -19,6 +19,8 @@ import ast.tpd._ import reporting.trace import reporting.diagnostic.Message +import scala.annotation.internal.sharable + trait TypeOps { this: Context => // TODO: Make standalone object. /** The type `tp` as seen from prefix `pre` and owner `cls`. See the spec diff --git a/compiler/src/dotty/tools/dotc/core/TyperState.scala b/compiler/src/dotty/tools/dotc/core/TyperState.scala index 6ae682ee5e2e..d176e5eddd99 100644 --- a/compiler/src/dotty/tools/dotc/core/TyperState.scala +++ b/compiler/src/dotty/tools/dotc/core/TyperState.scala @@ -14,6 +14,8 @@ import collection.mutable import java.lang.ref.WeakReference import Decorators._ +import scala.annotation.internal.sharable + object TyperState { @sharable private var nextId: Int = 0 } diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 9b293c01791a..948c0bfc1606 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -36,6 +36,8 @@ import scala.util.hashing.{ MurmurHash3 => hashing } import config.Printers.{core, typr} import java.lang.ref.WeakReference +import scala.annotation.internal.sharable + object Types { @sharable private[this] var nextId = 0 diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 0602b770233a..49459ac9f0e3 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -755,6 +755,20 @@ class ClassfileParser( } def unpickleScala(bytes: Array[Byte]): Some[Embedded] = { + val allowed = ctx.settings.Yscala2Unpickler.value + + def failUnless(cond: Boolean) = + assert(cond, + s"Unpickling ${classRoot.symbol.showLocated} from ${classRoot.symbol.associatedFile} is not allowed with -Yscala2-unpickler $allowed") + + if (allowed != "always") { + failUnless(allowed != "never") + val allowedList = allowed.split(":").toList + val file = classRoot.symbol.associatedFile + // Using `.toString.contains` isn't great, but it's good enough for a debug flag. + failUnless(file == null || allowedList.exists(path => file.toString.contains(path))) + } + val unpickler = new unpickleScala2.Scala2Unpickler(bytes, classRoot, moduleRoot)(ctx) unpickler.run()(ctx.addMode(Scala2UnpicklingMode)) Some(unpickler) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index aafad008fef6..79227028e1e1 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -25,6 +25,8 @@ import scala.quoted import scala.quoted.Types.TreeType import scala.quoted.Exprs.TastyTreeExpr +import scala.annotation.internal.sharable + /** Unpickler for typed trees * @param reader the reader from which to unpickle * @param posUnpicklerOpt the unpickler for positions, if it exists diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index a340d9160150..8c4254c2b5f5 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2,6 +2,7 @@ package dotty.tools package dotc package parsing +import scala.annotation.internal.sharable import scala.collection.mutable.ListBuffer import scala.collection.immutable.BitSet import util.{ SourceFile, SourcePosition } diff --git a/compiler/src/dotty/tools/dotc/printing/Printer.scala b/compiler/src/dotty/tools/dotc/printing/Printer.scala index f054a3dcb357..fc011b9f1ab5 100644 --- a/compiler/src/dotty/tools/dotc/printing/Printer.scala +++ b/compiler/src/dotty/tools/dotc/printing/Printer.scala @@ -9,6 +9,8 @@ import Types.Type, Symbols.Symbol, Contexts.Context, Scopes.Scope, Constants.Con import typer.Implicits.SearchResult import typer.ImportInfo +import scala.annotation.internal.sharable + /** The base class of all printers */ abstract class Printer { diff --git a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala index 16041eb32340..4e556af7ea5c 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala @@ -2,6 +2,8 @@ package dotty.tools package dotc package reporting +import scala.annotation.internal.sharable + import core.Contexts._ import util.{SourcePosition, NoSourcePosition} import core.Decorators.PhaseListDecorator diff --git a/compiler/src/dotty/tools/dotc/transform/CheckReentrant.scala b/compiler/src/dotty/tools/dotc/transform/CheckReentrant.scala index c60d8edf04fc..49be540f92ab 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckReentrant.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckReentrant.scala @@ -50,9 +50,9 @@ class CheckReentrant extends MiniPhase { private[this] var indent: Int = 0 private val sharableAnnot = new CtxLazy(implicit ctx => - ctx.requiredClass("dotty.tools.sharable")) + ctx.requiredClass("scala.annotation.internal.sharable")) private val unsharedAnnot = new CtxLazy(implicit ctx => - ctx.requiredClass("dotty.tools.unshared")) + ctx.requiredClass("scala.annotation.internal.unshared")) def isIgnored(sym: Symbol)(implicit ctx: Context) = sym.hasAnnotation(sharableAnnot()) || @@ -92,4 +92,4 @@ class CheckReentrant extends MiniPhase { addVars(tree.symbol.owner.asClass) tree } -} \ No newline at end of file +} diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index c3e5ab431213..a1cd253a26fd 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -37,6 +37,8 @@ import config.Printers.{implicits, implicitsDetailed, typr} import collection.mutable import reporting.trace +import scala.annotation.internal.sharable + /** Implicit resolution */ object Implicits { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index 151aae7ff77e..66adb91941b1 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -22,6 +22,8 @@ import reporting._ import collection.mutable import config.Config +import scala.annotation.internal.sharable + object Inferencing { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index fe902a13de51..e592d3b2517d 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -19,6 +19,8 @@ import ErrorReporting.errorType import config.Printers.typr import collection.mutable +import scala.annotation.internal.sharable + object ProtoTypes { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/util/NameTransformer.scala b/compiler/src/dotty/tools/dotc/util/NameTransformer.scala index 18c5b09823b2..65e9fef8ddb8 100644 --- a/compiler/src/dotty/tools/dotc/util/NameTransformer.scala +++ b/compiler/src/dotty/tools/dotc/util/NameTransformer.scala @@ -7,6 +7,8 @@ import core.Decorators._ import collection.mutable import util.Chars.isValidJVMMethodChar +import scala.annotation.internal.sharable + /** Provides functions to encode and decode Scala symbolic names. */ object NameTransformer { diff --git a/compiler/src/dotty/tools/dotc/util/SourceFile.scala b/compiler/src/dotty/tools/dotc/util/SourceFile.scala index d80c49617290..d7cafdaba633 100644 --- a/compiler/src/dotty/tools/dotc/util/SourceFile.scala +++ b/compiler/src/dotty/tools/dotc/util/SourceFile.scala @@ -11,6 +11,7 @@ import Chars._ import ScriptSourceFile._ import Positions._ import scala.io.Codec +import scala.annotation.internal.sharable import java.util.Optional diff --git a/compiler/src/dotty/tools/dotc/util/SourcePosition.scala b/compiler/src/dotty/tools/dotc/util/SourcePosition.scala index 89aa413f6308..06f4ccc6e1f5 100644 --- a/compiler/src/dotty/tools/dotc/util/SourcePosition.scala +++ b/compiler/src/dotty/tools/dotc/util/SourcePosition.scala @@ -4,6 +4,8 @@ package util import Positions.{Position, NoPosition} +import scala.annotation.internal.sharable + /** A source position is comprised of a position in a source file */ case class SourcePosition(source: SourceFile, pos: Position, outer: SourcePosition = NoSourcePosition) extends interfaces.SourcePosition { diff --git a/compiler/src/dotty/tools/dotc/util/Stats.scala b/compiler/src/dotty/tools/dotc/util/Stats.scala index 38f0fa0db99d..283fce5279e0 100644 --- a/compiler/src/dotty/tools/dotc/util/Stats.scala +++ b/compiler/src/dotty/tools/dotc/util/Stats.scala @@ -2,6 +2,8 @@ package dotty.tools package dotc package util +import scala.annotation.internal.sharable + import core.Contexts._ import collection.mutable diff --git a/compiler/src/dotty/tools/package.scala b/compiler/src/dotty/tools/package.scala index 220eb6b7588b..d0501e53fed8 100644 --- a/compiler/src/dotty/tools/package.scala +++ b/compiler/src/dotty/tools/package.scala @@ -2,9 +2,6 @@ package dotty import scala.annotation.Annotation package object tools { - class sharable extends Annotation - class unshared extends Annotation - // Ensure this object is already classloaded, since it's only actually used // when handling stack overflows and every operation (including class loading) // risks failing. diff --git a/compiler/src/dotty/tools/repl/ParseResult.scala b/compiler/src/dotty/tools/repl/ParseResult.scala index 40f76d77ca32..2722cd5f6b2e 100644 --- a/compiler/src/dotty/tools/repl/ParseResult.scala +++ b/compiler/src/dotty/tools/repl/ParseResult.scala @@ -11,6 +11,8 @@ import dotc.reporting._ import results._ +import scala.annotation.internal.sharable + /** A parsing result from string input */ sealed trait ParseResult diff --git a/compiler/test/dotty/Jars.scala b/compiler/test/dotty/Jars.scala index 1c80b02b7c86..4959fc95aa2f 100644 --- a/compiler/test/dotty/Jars.scala +++ b/compiler/test/dotty/Jars.scala @@ -18,6 +18,10 @@ object Jars { lazy val scalaAsm: String = findJarFromRuntime("scala-asm-6.0.0-scala-1") + /** scala-xml jar */ + lazy val scalaXml: String = + findJarFromRuntime("scala-xml") + /** JLine Jar */ lazy val jline: String = findJarFromRuntime("jline-3.7.0") diff --git a/compiler/test/dotty/TestCategories.scala b/compiler/test/dotty/TestCategories.scala index d7a011719637..696912ff9495 100644 --- a/compiler/test/dotty/TestCategories.scala +++ b/compiler/test/dotty/TestCategories.scala @@ -5,3 +5,6 @@ trait SlowTests /** Meta tests category for JUnit */ trait VulpixMetaTests + +/** Tests that should only be run with a bootstrapped compiler */ +trait BootstrappedOnlyTests diff --git a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala new file mode 100644 index 000000000000..0eaf9368c159 --- /dev/null +++ b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala @@ -0,0 +1,115 @@ +package dotty +package tools +package dotc + +import org.junit.{ Test, BeforeClass, AfterClass } +import org.junit.Assert._ +import org.junit.Assume._ +import org.junit.experimental.categories.Category + +import java.nio.file._ +import java.util.stream.{ Stream => JStream } +import scala.collection.JavaConverters._ +import scala.util.matching.Regex +import scala.concurrent.duration._ +import vulpix._ +import dotty.tools.io.JFile + +@Category(Array(classOf[BootstrappedOnlyTests])) +class BootstrappedOnlyCompilationTests extends ParallelTesting { + import ParallelTesting._ + import TestConfiguration._ + import CompilationTests._ + + // Test suite configuration -------------------------------------------------- + + def maxDuration = 30.seconds + def numberOfSlaves = 5 + def safeMode = Properties.testsSafeMode + def isInteractive = SummaryReport.isInteractive + def testFilter = Properties.testsFilter + + // Positive tests ------------------------------------------------------------ + + @Test def posWithCompiler: Unit = { + implicit val testGroup: TestGroup = TestGroup("compilePosWithCompiler") + compileFilesInDir("tests/pos-with-compiler", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/ast", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/config", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/core", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/transform", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/parsing", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/printing", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/reporting", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/typer", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/util", defaultOptions) + + compileDir("compiler/src/dotty/tools/io", defaultOptions) + + compileDir("compiler/src/dotty/tools/dotc/core", TestFlags(classPath, noCheckOptions)) + } + + @Test def posTwiceWithCompiler: Unit = { + implicit val testGroup: TestGroup = TestGroup("posTwiceWithCompiler") + compileFile("tests/pos-with-compiler/Labels.scala", defaultOptions) + + compileFile("tests/pos-with-compiler/Patterns.scala", defaultOptions) + + compileList( + "testNonCyclic", + List( + "compiler/src/dotty/tools/dotc/CompilationUnit.scala", + "compiler/src/dotty/tools/dotc/core/Types.scala", + "compiler/src/dotty/tools/dotc/ast/Trees.scala" + ), + defaultOptions.and("-Xprompt") + ) + + compileList( + "testIssue34", + List( + "compiler/src/dotty/tools/dotc/config/Properties.scala", + "compiler/src/dotty/tools/dotc/config/PathResolver.scala" + ), + defaultOptions.and("-Xprompt") + ) + }.times(2).checkCompile() + + // Negative tests ------------------------------------------------------------ + + @Test def negAll: Unit = { + implicit val testGroup: TestGroup = TestGroup("compileNegWithCompiler") + compileFilesInDir("tests/neg-with-compiler", defaultOptions) + }.checkExpectedErrors() + + // Run tests ----------------------------------------------------------------- + + @Test def runWithCompiler: Unit = { + implicit val testGroup: TestGroup = TestGroup("runWithCompiler") + compileFilesInDir("tests/run-with-compiler", defaultRunWithCompilerOptions) + + compileFile("tests/run-with-compiler-custom-args/staged-streams_1.scala", defaultRunWithCompilerOptions without "-Yno-deep-subtypes") + }.checkRuns() + + // Pickling Tests ------------------------------------------------------------ + // + // Pickling tests are very memory intensive and as such need to be run with a + // lower level of concurrency as to not kill their running VMs + + @Test def picklingWithCompiler: Unit = { + implicit val testGroup: TestGroup = TestGroup("testPicklingWithCompiler") + compileDir("compiler/src/dotty/tools", picklingOptions, recursive = false) + + compileDir("compiler/src/dotty/tools/dotc", picklingOptions, recursive = false) + + compileDir("library/src/dotty/runtime", picklingOptions) + + compileDir("compiler/src/dotty/tools/backend/jvm", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/ast", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/core", picklingOptions, recursive = false) + + compileDir("compiler/src/dotty/tools/dotc/config", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/parsing", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/printing", picklingOptions) + + compileDir("compiler/src/dotty/tools/repl", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/rewrite", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/transform", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/typer", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/util", picklingOptions) + + compileDir("compiler/src/dotty/tools/io", picklingOptions) + + compileFile("tests/pos/pickleinf.scala", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/core/classfile", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/core/tasty", picklingOptions) + + compileDir("compiler/src/dotty/tools/dotc/core/unpickleScala2", picklingOptions) + }.limitThreads(4).checkCompile() +} diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 10055f39aa72..90521d3acca4 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -37,20 +37,9 @@ class CompilationTests extends ParallelTesting { compileList("compileStdLib", TestSources.stdLibWhitelisted, scala2Mode.and("-migration", "-Yno-inline", "-Ydetailed-stats")) }.checkCompile() - @Test def compilePos: Unit = { + @Test def pos: Unit = { implicit val testGroup: TestGroup = TestGroup("compilePos") compileList("compileStdLib", TestSources.stdLibWhitelisted, scala2Mode.and("-migration", "-Yno-inline")) + - compileDir("compiler/src/dotty/tools/dotc/ast", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/config", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/core", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/transform", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/parsing", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/printing", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/reporting", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/typer", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/util", defaultOptions) + - compileDir("compiler/src/dotty/tools/io", defaultOptions) + - compileDir("compiler/src/dotty/tools/dotc/core", TestFlags(classPath, noCheckOptions)) + compileFile("tests/pos/nullarify.scala", defaultOptions.and("-Ycheck:nullarify")) + compileFile("tests/pos-scala2/rewrites.scala", scala2Mode.and("-rewrite")).copyToTarget() + compileFile("tests/pos-special/utf8encoded.scala", explicitUTF8) + @@ -111,7 +100,6 @@ class CompilationTests extends ParallelTesting { @Test def posTwice: Unit = { implicit val testGroup: TestGroup = TestGroup("posTwice") - compileFile("tests/pos/Labels.scala", defaultOptions) + compileFilesInDir("tests/pos-java-interop", defaultOptions) + compileFilesInDir("tests/pos-java-interop-separate", defaultOptions) + compileFile("tests/pos/t2168.scala", defaultOptions) + @@ -122,7 +110,6 @@ class CompilationTests extends ParallelTesting { compileFile("tests/pos/functions1.scala", defaultOptions) + compileFile("tests/pos/implicits1.scala", defaultOptions) + compileFile("tests/pos/inferred.scala", defaultOptions) + - compileFile("tests/pos/Patterns.scala", defaultOptions) + compileFile("tests/pos/selftypes.scala", defaultOptions) + compileFile("tests/pos/varargs.scala", defaultOptions) + compileFile("tests/pos/vararg-pattern.scala", defaultOptions) + @@ -147,29 +134,12 @@ class CompilationTests extends ParallelTesting { compileFile("tests/pos/i0239.scala", defaultOptions) + compileFile("tests/pos/anonClassSubtyping.scala", defaultOptions) + compileFile("tests/pos/extmethods.scala", defaultOptions) + - compileFile("tests/pos/companions.scala", defaultOptions) + - compileList( - "testNonCyclic", - List( - "compiler/src/dotty/tools/dotc/CompilationUnit.scala", - "compiler/src/dotty/tools/dotc/core/Types.scala", - "compiler/src/dotty/tools/dotc/ast/Trees.scala" - ), - defaultOptions.and("-Xprompt") - ) + - compileList( - "testIssue34", - List( - "compiler/src/dotty/tools/dotc/config/Properties.scala", - "compiler/src/dotty/tools/dotc/config/PathResolver.scala" - ), - defaultOptions.and("-Xprompt") - ) + compileFile("tests/pos/companions.scala", defaultOptions) }.times(2).checkCompile() // Negative tests ------------------------------------------------------------ - @Test def compileNeg: Unit = { + @Test def negAll: Unit = { implicit val testGroup: TestGroup = TestGroup("compileNeg") compileFilesInDir("tests/neg", defaultOptions) + compileFilesInDir("tests/neg-tailcall", defaultOptions) + @@ -195,9 +165,7 @@ class CompilationTests extends ParallelTesting { @Test def runAll: Unit = { implicit val testGroup: TestGroup = TestGroup("runAll") - compileFilesInDir("tests/run", defaultOptions) + - compileFilesInDir("tests/run-with-compiler", defaultRunWithCompilerOptions) + - compileFile("tests/run-with-compiler-custom-args/staged-streams_1.scala", defaultRunWithCompilerOptions without "-Yno-deep-subtypes") + compileFilesInDir("tests/run", defaultOptions) }.checkRuns() // Generic java signatures tests --------------------------------------------- @@ -208,34 +176,12 @@ class CompilationTests extends ParallelTesting { }.checkRuns() // Pickling Tests ------------------------------------------------------------ - // - // Pickling tests are very memory intensive and as such need to be run with a - // lower level of concurrency as to not kill their running VMs - @Test def testPickling: Unit = { + @Test def pickling: Unit = { implicit val testGroup: TestGroup = TestGroup("testPickling") - compileDir("compiler/src/dotty/tools", picklingOptions, recursive = false) + - compileDir("compiler/src/dotty/tools/dotc", picklingOptions, recursive = false) + compileFilesInDir("tests/new", picklingOptions) + - compileFilesInDir("tests/pickling", picklingOptions) + - compileDir("library/src/dotty/runtime", picklingOptions) + - compileDir("compiler/src/dotty/tools/backend/jvm", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/ast", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/core", picklingOptions, recursive = false) + - compileDir("compiler/src/dotty/tools/dotc/config", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/parsing", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/printing", picklingOptions) + - compileDir("compiler/src/dotty/tools/repl", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/rewrite", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/transform", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/typer", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/util", picklingOptions) + - compileDir("compiler/src/dotty/tools/io", picklingOptions) + - compileFile("tests/pos/pickleinf.scala", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/core/classfile", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/core/tasty", picklingOptions) + - compileDir("compiler/src/dotty/tools/dotc/core/unpickleScala2", picklingOptions) - }.limitThreads(4).checkCompile() + compileFilesInDir("tests/pickling", picklingOptions) + }.checkCompile() /** The purpose of this test is two-fold, being able to compile dotty * bootstrapped, and making sure that TASTY can link against a compiled diff --git a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala index 3d389597a226..de95fef27792 100644 --- a/compiler/test/dotty/tools/vulpix/TestConfiguration.scala +++ b/compiler/test/dotty/tools/vulpix/TestConfiguration.scala @@ -10,6 +10,7 @@ object TestConfiguration { ) val checkOptions = Array( + "-Yscala2-unpickler", s"${Jars.scalaLibrary}:${Jars.scalaXml}", "-Yno-deep-subtypes", "-Yno-double-bindings", "-Yforce-sbt-phases", diff --git a/library/src/scala/annotation/internal/sharable.scala b/library/src/scala/annotation/internal/sharable.scala new file mode 100644 index 000000000000..e2d6dcc61beb --- /dev/null +++ b/library/src/scala/annotation/internal/sharable.scala @@ -0,0 +1,9 @@ +package scala.annotation.internal + +import scala.annotation.Annotation + +/** An annotation indicating to `-Ycheck:reentrant` that a class or val can be safely shared. + * + * @see scala.annotation.internal.unshared + */ +class sharable extends Annotation diff --git a/library/src/scala/annotation/internal/unshared.scala b/library/src/scala/annotation/internal/unshared.scala new file mode 100644 index 000000000000..89796eba09e3 --- /dev/null +++ b/library/src/scala/annotation/internal/unshared.scala @@ -0,0 +1,9 @@ +package scala.annotation.internal + +import scala.annotation.Annotation + +/** An annotation indicating to `-Ycheck:reentrant` that an object will not be accessed from multiple threads. + * + * @see scala.annotation.internal.sharable + */ +class unshared extends Annotation diff --git a/project/Build.scala b/project/Build.scala index 42c942a96b33..f34e0a5be20f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -227,6 +227,13 @@ object Build { // otherwise sbt 0.13 incremental compilation breaks (https://github.com/sbt/sbt/issues/3142) scalacOptions ++= Seq("-bootclasspath", sys.props("sun.boot.class.path")), + // Enforce that the only Scala 2 classfiles we unpickle come from scala-library + scalacOptions ++= { + val attList = (dependencyClasspath in `dotty-library` in Compile).value + val scalaLib = findLib(attList, "scala-library") + Seq("-Yscala2-unpickler", scalaLib) + }, + // sbt gets very unhappy if two projects use the same target target := baseDirectory.value / ".." / "out" / "bootstrap" / name.value, @@ -427,6 +434,11 @@ object Build { (testOnly in Test).toTask(cmd) } + def findLib(attList: Seq[Attributed[File]], name: String) = attList + .map(_.data.getAbsolutePath) + .find(_.contains(name)) + .toList.mkString(":") + // Settings shared between dotty-compiler and dotty-compiler-bootstrapped lazy val commonDottyCompilerSettings = Seq( @@ -518,7 +530,8 @@ object Build { }, testOptions in Test += Tests.Argument( - TestFrameworks.JUnit, "--run-listener=dotty.tools.ContextEscapeDetector" + TestFrameworks.JUnit, + "--run-listener=dotty.tools.ContextEscapeDetector", ), // Spawn new JVM in run and test @@ -573,7 +586,7 @@ object Build { jarOpts ::: tuning ::: agentOptions ::: ci_build ::: path.toList }, - testCompilation := testOnlyFiltered("dotty.tools.dotc.CompilationTests", "--exclude-categories=dotty.SlowTests").evaluated, + testCompilation := testOnlyFiltered("dotty.tools.dotc.*CompilationTests", "--exclude-categories=dotty.SlowTests").evaluated, testFromTasty := testOnlyFiltered("dotty.tools.dotc.FromTastyTests", "").evaluated, dotr := { @@ -581,12 +594,7 @@ object Build { val attList = (dependencyClasspath in Runtime).value val jars = packageAll.value - def findLib(name: String) = attList - .map(_.data.getAbsolutePath) - .find(_.contains(name)) - .toList.mkString(":") - - val scalaLib = findLib("scala-library") + val scalaLib = findLib(attList, "scala-library") val dottyLib = jars("dotty-library") def run(args: List[String]): Unit = { @@ -599,8 +607,11 @@ object Build { } else if (scalaLib == "") { println("Couldn't find scala-library on classpath, please run using script in bin dir instead") } else if (args.contains("-with-compiler")) { + if (!isDotty.value) { + throw new MessageOnlyException("-with-compiler can only be used with a bootstrapped compiler") + } val args1 = args.filter(_ != "-with-compiler") - val asm = findLib("scala-asm") + val asm = findLib(attList, "scala-asm") val dottyCompiler = jars("dotty-compiler") val dottyInterfaces = jars("dotty-interfaces") run(insertClasspathInArgs(args1, s"$dottyCompiler:$dottyInterfaces:$asm")) @@ -664,7 +675,12 @@ object Build { var extraClasspath = dottyLib if ((decompile || printTasty) && !args.contains("-classpath")) extraClasspath += ":." - if (args0.contains("-with-compiler")) extraClasspath += s":$dottyCompiler" + if (args0.contains("-with-compiler")) { + if (!isDotty.value) { + throw new MessageOnlyException("-with-compiler can only be used with a bootstrapped compiler") + } + extraClasspath += s":$dottyCompiler" + } val fullArgs = main :: insertClasspathInArgs(args, extraClasspath) @@ -679,21 +695,31 @@ object Build { lazy val nonBootstrapedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq( // packageAll packages all and then returns a map with the abs location - packageAll := { - Map( - "dotty-interfaces" -> packageBin.in(`dotty-interfaces`, Compile).value, - "dotty-compiler" -> packageBin.in(Compile).value, - "dotty-library" -> packageBin.in(`dotty-library`, Compile).value, - "dotty-compiler-test" -> packageBin.in(Test).value - ).mapValues(_.getAbsolutePath) - } + packageAll := Def.taskDyn { // Use a dynamic task to avoid loops when loading the settings + Def.task { + Map( + "dotty-interfaces" -> packageBin.in(`dotty-interfaces`, Compile).value, + "dotty-compiler" -> packageBin.in(Compile).value, + + // NOTE: Using dotty-library-bootstrapped here is intentional: when + // running the compiler, we should always have the bootstrapped + // library on the compiler classpath since the non-bootstrapped one + // may not be binary-compatible. + "dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value + ).mapValues(_.getAbsolutePath) + } + }.value, + + testOptions in Test += Tests.Argument( + TestFrameworks.JUnit, + "--exclude-categories=dotty.BootstrappedOnlyTests", + ), ) lazy val bootstrapedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq( packageAll := { packageAll.in(`dotty-compiler`).value ++ Seq( - "dotty-compiler" -> packageBin.in(Compile).value.getAbsolutePath, - "dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value.getAbsolutePath + "dotty-compiler" -> packageBin.in(Compile).value.getAbsolutePath ) } ) @@ -756,6 +782,21 @@ object Build { lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge")).asDottySbtBridge(NonBootstrapped) lazy val `dotty-sbt-bridge-bootstrapped` = project.in(file("sbt-bridge")).asDottySbtBridge(Bootstrapped) + .settings( + // Tweak -Yscala2-unpickler to allow some sbt dependencies used in tests + scalacOptions in Test := { + val oldOptions = (scalacOptions in Test).value + val i = oldOptions.indexOf("-Yscala2-unpickler") + assert(i != -1) + val oldValue = oldOptions(i + 1) + + val attList = (dependencyClasspath in Test).value + val sbtIo = findLib(attList, "org.scala-sbt/io") + val zincApiInfo = findLib(attList, "zinc-apiinfo") + + oldOptions.updated(i + 1, s"$sbtIo:$zincApiInfo:$oldValue") + } + ) lazy val `dotty-language-server` = project.in(file("language-server")). dependsOn(dottyCompiler(Bootstrapped)). diff --git a/project/scripts/cmdTests b/project/scripts/cmdTests index 203b8e78fa01..1933812f2c17 100755 --- a/project/scripts/cmdTests +++ b/project/scripts/cmdTests @@ -8,7 +8,6 @@ SBT="./project/scripts/sbt" # if run on CI SOURCE="tests/pos/HelloWorld.scala" MAIN="HelloWorld" EXPECTED_OUTPUT="hello world" -COMPILER_CP="compiler/target/scala-2.12/classes" # FIXME: This is not very reliable # check that benchmarks can run "$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala" @@ -51,7 +50,7 @@ clear_out "$OUT" grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp" echo "testing scala.quoted.Expr.run from sbt dotr" -"$SBT" ";dotty-compiler/compile ;dotc -classpath $COMPILER_CP tests/run-with-compiler/quote-run.scala; dotr -with-compiler Test" > "$tmp" +"$SBT" ";dotty-compiler-bootstrapped/dotc -with-compiler tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "$tmp" grep -qe "val a: scala.Int = 3" "$tmp" diff --git a/tests/neg/Main.scala b/tests/neg-with-compiler/Main.scala similarity index 100% rename from tests/neg/Main.scala rename to tests/neg-with-compiler/Main.scala diff --git a/tests/neg/quote-run-in-macro-1/quoted_1.scala b/tests/neg-with-compiler/quote-run-in-macro-1/quoted_1.scala similarity index 100% rename from tests/neg/quote-run-in-macro-1/quoted_1.scala rename to tests/neg-with-compiler/quote-run-in-macro-1/quoted_1.scala diff --git a/tests/neg/quote-run-in-macro-1/quoted_2.scala b/tests/neg-with-compiler/quote-run-in-macro-1/quoted_2.scala similarity index 100% rename from tests/neg/quote-run-in-macro-1/quoted_2.scala rename to tests/neg-with-compiler/quote-run-in-macro-1/quoted_2.scala diff --git a/tests/neg/quote-run-in-macro-2/quoted_1.scala b/tests/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala similarity index 100% rename from tests/neg/quote-run-in-macro-2/quoted_1.scala rename to tests/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala diff --git a/tests/neg/quote-run-in-macro-2/quoted_2.scala b/tests/neg-with-compiler/quote-run-in-macro-2/quoted_2.scala similarity index 100% rename from tests/neg/quote-run-in-macro-2/quoted_2.scala rename to tests/neg-with-compiler/quote-run-in-macro-2/quoted_2.scala diff --git a/tests/pickling/A.scala b/tests/pos-with-compiler/A.scala similarity index 100% rename from tests/pickling/A.scala rename to tests/pos-with-compiler/A.scala diff --git a/tests/pickling/B.scala b/tests/pos-with-compiler/B.scala similarity index 100% rename from tests/pickling/B.scala rename to tests/pos-with-compiler/B.scala diff --git a/tests/pos/Fileish.scala b/tests/pos-with-compiler/Fileish.scala similarity index 100% rename from tests/pos/Fileish.scala rename to tests/pos-with-compiler/Fileish.scala diff --git a/tests/pos/Labels.scala b/tests/pos-with-compiler/Labels.scala similarity index 100% rename from tests/pos/Labels.scala rename to tests/pos-with-compiler/Labels.scala diff --git a/tests/pos/Patterns.scala b/tests/pos-with-compiler/Patterns.scala similarity index 100% rename from tests/pos/Patterns.scala rename to tests/pos-with-compiler/Patterns.scala diff --git a/tests/pos/i143.scala b/tests/pos-with-compiler/i143.scala similarity index 100% rename from tests/pos/i143.scala rename to tests/pos-with-compiler/i143.scala diff --git a/tests/pos/quote-0.scala b/tests/pos-with-compiler/quote-0.scala similarity index 100% rename from tests/pos/quote-0.scala rename to tests/pos-with-compiler/quote-0.scala diff --git a/tests/pos/quote-assert/quoted_1.scala b/tests/pos-with-compiler/quote-assert/quoted_1.scala similarity index 100% rename from tests/pos/quote-assert/quoted_1.scala rename to tests/pos-with-compiler/quote-assert/quoted_1.scala diff --git a/tests/pos/quote-assert/quoted_2.scala b/tests/pos-with-compiler/quote-assert/quoted_2.scala similarity index 100% rename from tests/pos/quote-assert/quoted_2.scala rename to tests/pos-with-compiler/quote-assert/quoted_2.scala diff --git a/tests/pos/tasty/definitions.scala b/tests/pos-with-compiler/tasty/definitions.scala similarity index 100% rename from tests/pos/tasty/definitions.scala rename to tests/pos-with-compiler/tasty/definitions.scala diff --git a/tests/pos/lazyValsSepComp.scala b/tests/pos/lazyValsSepComp.scala deleted file mode 100644 index 048231eb00c3..000000000000 --- a/tests/pos/lazyValsSepComp.scala +++ /dev/null @@ -1,16 +0,0 @@ -package dotty.tools -package io - -import java.io.{ InputStream } -import java.util.jar.JarEntry -import dotty.tools.dotc.core.Definitions -import language.postfixOps -import dotty.tools.dotc.core.Contexts._ - - -/** A test to trigger issue with separate compilation between Dotty and Scalac and lazy vals */ -object Foo { - val definitions: Definitions = null - def defn = definitions - def go = defn.FunctionClassPerRun -} diff --git a/tests/run/quote-impure-by-name.check b/tests/run-with-compiler/quote-impure-by-name.check similarity index 100% rename from tests/run/quote-impure-by-name.check rename to tests/run-with-compiler/quote-impure-by-name.check diff --git a/tests/run/quote-impure-by-name/quoted_1.scala b/tests/run-with-compiler/quote-impure-by-name/quoted_1.scala similarity index 100% rename from tests/run/quote-impure-by-name/quoted_1.scala rename to tests/run-with-compiler/quote-impure-by-name/quoted_1.scala diff --git a/tests/run/quote-impure-by-name/quoted_2.scala b/tests/run-with-compiler/quote-impure-by-name/quoted_2.scala similarity index 100% rename from tests/run/quote-impure-by-name/quoted_2.scala rename to tests/run-with-compiler/quote-impure-by-name/quoted_2.scala diff --git a/tests/run/quote-inline-function.check b/tests/run-with-compiler/quote-inline-function.check similarity index 100% rename from tests/run/quote-inline-function.check rename to tests/run-with-compiler/quote-inline-function.check diff --git a/tests/run/quote-inline-function/quoted_1.scala b/tests/run-with-compiler/quote-inline-function/quoted_1.scala similarity index 100% rename from tests/run/quote-inline-function/quoted_1.scala rename to tests/run-with-compiler/quote-inline-function/quoted_1.scala diff --git a/tests/run/quote-inline-function/quoted_2.scala b/tests/run-with-compiler/quote-inline-function/quoted_2.scala similarity index 100% rename from tests/run/quote-inline-function/quoted_2.scala rename to tests/run-with-compiler/quote-inline-function/quoted_2.scala diff --git a/tests/run/quote-splice-interpret-1.check b/tests/run-with-compiler/quote-splice-interpret-1.check similarity index 100% rename from tests/run/quote-splice-interpret-1.check rename to tests/run-with-compiler/quote-splice-interpret-1.check diff --git a/tests/run/quote-splice-interpret-1/Macro_1.scala b/tests/run-with-compiler/quote-splice-interpret-1/Macro_1.scala similarity index 100% rename from tests/run/quote-splice-interpret-1/Macro_1.scala rename to tests/run-with-compiler/quote-splice-interpret-1/Macro_1.scala diff --git a/tests/run/quote-splice-interpret-1/Test_2.scala b/tests/run-with-compiler/quote-splice-interpret-1/Test_2.scala similarity index 100% rename from tests/run/quote-splice-interpret-1/Test_2.scala rename to tests/run-with-compiler/quote-splice-interpret-1/Test_2.scala diff --git a/tests/run/tasty-extractors-constants-2.check b/tests/run-with-compiler/tasty-extractors-constants-2.check similarity index 100% rename from tests/run/tasty-extractors-constants-2.check rename to tests/run-with-compiler/tasty-extractors-constants-2.check diff --git a/tests/run/tasty-extractors-constants-2/quoted_1.scala b/tests/run-with-compiler/tasty-extractors-constants-2/quoted_1.scala similarity index 100% rename from tests/run/tasty-extractors-constants-2/quoted_1.scala rename to tests/run-with-compiler/tasty-extractors-constants-2/quoted_1.scala diff --git a/tests/run/tasty-extractors-constants-2/quoted_2.scala b/tests/run-with-compiler/tasty-extractors-constants-2/quoted_2.scala similarity index 100% rename from tests/run/tasty-extractors-constants-2/quoted_2.scala rename to tests/run-with-compiler/tasty-extractors-constants-2/quoted_2.scala diff --git a/tests/run/lst/Lst.scala b/tests/run/lst/Lst.scala index 3f6500d475dc..85ef6729c081 100644 --- a/tests/run/lst/Lst.scala +++ b/tests/run/lst/Lst.scala @@ -1,8 +1,5 @@ -package dotty.tools.dotc -package util +package lst -import printing.{Printer, Texts} -import Texts.Text import collection.mutable.{ListBuffer, StringBuilder} import collection.immutable.Map import reflect.ClassTag diff --git a/tests/run/lst/LstTest.scala b/tests/run/lst/LstTest.scala index 9f7c7a7ff1c6..8b1e7ad8b166 100644 --- a/tests/run/lst/LstTest.scala +++ b/tests/run/lst/LstTest.scala @@ -1,5 +1,5 @@ object Test extends App { - import dotty.tools.dotc.util.Lst + import lst.Lst val xs0: Lst[String] = Lst.Empty val xs1 = Lst("a")