From f3b66e148efeed4c11958c35974e52dffbf93744 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 22 Feb 2022 05:59:07 -0800 Subject: [PATCH] Edit unused imports --- .../src/dotty/tools/MainGenericRunner.scala | 5 ++--- .../tools/backend/WorklistAlgorithm.scala | 2 -- .../tools/backend/jvm/BCodeAsmCommon.scala | 2 +- .../tools/backend/jvm/BCodeBodyBuilder.scala | 4 +--- .../tools/backend/jvm/BCodeHelpers.scala | 3 +-- .../tools/backend/jvm/BCodeIdiomatic.scala | 1 - .../tools/backend/jvm/BCodeSkelBuilder.scala | 4 ---- .../tools/backend/jvm/BCodeSyncAndTry.scala | 3 +-- .../src/dotty/tools/backend/jvm/BTypes.scala | 2 +- .../tools/backend/jvm/BytecodeWriters.scala | 5 +---- .../dotty/tools/backend/jvm/CoreBTypes.scala | 5 +---- .../backend/jvm/DottyBackendInterface.scala | 19 +++---------------- .../dotty/tools/backend/jvm/GenBCode.scala | 1 - .../tools/backend/jvm/scalaPrimitives.scala | 2 -- .../dotty/tools/backend/sjs/JSCodeGen.scala | 7 ------- .../tools/backend/sjs/JSDefinitions.scala | 2 -- .../dotty/tools/backend/sjs/JSEncoding.scala | 11 ----------- .../tools/backend/sjs/JSExportsGen.scala | 12 ++---------- .../tools/backend/sjs/JSPrimitives.scala | 4 ---- .../dotty/tools/backend/sjs/ScopedVar.scala | 2 -- .../dotty/tools/dotc/CompilationUnit.scala | 1 - compiler/src/dotty/tools/dotc/Driver.scala | 6 +----- compiler/src/dotty/tools/dotc/Run.scala | 9 ++++----- .../src/dotty/tools/dotc/ast/Desugar.scala | 4 ++-- .../dotty/tools/dotc/ast/DesugarEnums.scala | 2 +- .../dotty/tools/dotc/ast/MainProxies.scala | 3 +-- .../dotty/tools/dotc/ast/NavigateAST.scala | 1 - .../src/dotty/tools/dotc/ast/Positioned.scala | 5 +---- .../tools/dotc/ast/TreeMapWithImplicits.scala | 2 -- compiler/src/dotty/tools/dotc/ast/Trees.scala | 1 - compiler/src/dotty/tools/dotc/ast/tpd.scala | 3 +-- compiler/src/dotty/tools/dotc/ast/untpd.scala | 1 - .../ZipAndJarFileLookupFactory.scala | 1 - .../dotty/tools/dotc/config/CliCommand.scala | 3 --- .../tools/dotc/config/CompilerCommand.scala | 5 ----- .../src/dotty/tools/dotc/config/Config.scala | 1 - .../src/dotty/tools/dotc/config/Feature.scala | 6 +++--- .../tools/dotc/config/JavaPlatform.scala | 2 +- .../tools/dotc/config/PathResolver.scala | 1 - .../dotty/tools/dotc/config/Platform.scala | 1 - .../dotty/tools/dotc/config/SJSPlatform.scala | 3 --- .../dotty/tools/dotc/config/Settings.scala | 1 - .../tools/dotc/config/SourceVersion.scala | 5 +---- .../dotty/tools/dotc/core/Annotations.scala | 9 +++------ .../src/dotty/tools/dotc/core/Comments.scala | 2 +- .../src/dotty/tools/dotc/core/Constants.scala | 1 - .../tools/dotc/core/ConstraintHandling.scala | 2 -- .../dotty/tools/dotc/core/ContextOps.scala | 4 ++-- .../dotty/tools/dotc/core/Decorators.scala | 5 +---- .../dotty/tools/dotc/core/Definitions.scala | 1 - .../dotty/tools/dotc/core/Denotations.scala | 1 - .../tools/dotc/core/GadtConstraint.scala | 1 - .../tools/dotc/core/JavaNullInterop.scala | 2 -- .../tools/dotc/core/MacroClassLoader.scala | 2 -- .../src/dotty/tools/dotc/core/NameOps.scala | 1 - .../src/dotty/tools/dotc/core/NamerOps.scala | 3 --- .../src/dotty/tools/dotc/core/Names.scala | 2 -- .../tools/dotc/core/NullOpsDecorator.scala | 4 +--- .../src/dotty/tools/dotc/core/Scopes.scala | 3 +-- .../tools/dotc/core/StagingContext.scala | 5 ----- .../src/dotty/tools/dotc/core/StdNames.scala | 1 - .../dotty/tools/dotc/core/Substituters.scala | 2 +- .../tools/dotc/core/SymDenotations.scala | 3 +-- .../dotty/tools/dotc/core/SymbolLoaders.scala | 3 --- .../src/dotty/tools/dotc/core/Symbols.scala | 5 +---- .../tools/dotc/core/TypeApplications.scala | 2 -- .../dotty/tools/dotc/core/TypeComparer.scala | 3 +-- .../src/dotty/tools/dotc/core/TypeOps.scala | 7 ++----- .../dotty/tools/dotc/core/TyperState.scala | 2 +- .../src/dotty/tools/dotc/core/Types.scala | 5 +---- .../dotc/core/classfile/ClassfileParser.scala | 8 +++----- .../dotc/core/tasty/CommentPickler.scala | 3 +-- .../tools/dotc/core/tasty/NameBuffer.scala | 1 - .../dotc/core/tasty/PositionUnpickler.scala | 1 - .../dotc/core/tasty/TastyClassName.scala | 4 +--- .../tools/dotc/core/tasty/TastyPickler.scala | 3 +-- .../tools/dotc/core/tasty/TastyPrinter.scala | 3 +-- .../tools/dotc/core/tasty/TreePickler.scala | 6 ------ .../tools/dotc/core/tasty/TreeUnpickler.scala | 6 +----- .../core/unpickleScala2/Scala2Erasure.scala | 1 - .../decompiler/DecompilationPrinter.scala | 1 - .../tools/dotc/fromtasty/TASTYCompiler.scala | 1 - .../tools/dotc/interactive/Completion.scala | 14 ++++---------- .../tools/dotc/interactive/Interactive.scala | 5 ----- .../dotc/interactive/InteractiveDriver.scala | 2 +- .../tools/dotc/interactive/SourceTree.scala | 1 - .../tools/dotc/parsing/JavaParsers.scala | 1 - .../tools/dotc/parsing/ParserPhase.scala | 3 --- .../dotty/tools/dotc/parsing/Parsers.scala | 5 ++--- .../dotty/tools/dotc/parsing/Scanners.scala | 7 +------ .../src/dotty/tools/dotc/plugins/Plugin.scala | 1 - .../dotc/printing/DecompilerPrinter.scala | 1 - .../tools/dotc/printing/RefinedPrinter.scala | 7 ++----- .../src/dotty/tools/dotc/printing/Texts.scala | 1 - .../tools/dotc/quoted/MacroExpansion.scala | 3 +-- .../tools/dotc/quoted/PickledQuotes.scala | 4 ---- .../dotty/tools/dotc/quoted/QuoteUtils.scala | 2 -- .../dotty/tools/dotc/quoted/QuotesCache.scala | 2 -- .../dotty/tools/dotc/quoted/TastyString.scala | 1 - .../dotc/quoted/reflect/FromSymbol.scala | 1 - .../dotc/reporting/ConsoleReporter.scala | 2 +- .../dotty/tools/dotc/reporting/Message.scala | 1 - .../dotty/tools/dotc/reporting/Reporter.scala | 3 --- .../dotty/tools/dotc/reporting/WConf.scala | 1 - .../dotty/tools/dotc/reporting/messages.scala | 1 - .../src/dotty/tools/dotc/sbt/APIUtils.scala | 5 ----- .../src/dotty/tools/dotc/sbt/ExtractAPI.scala | 4 +--- .../tools/dotc/sbt/ExtractDependencies.scala | 2 -- .../dotc/semanticdb/ExtractSemanticDB.scala | 6 +----- .../tools/dotc/semanticdb/Language.scala | 1 - .../dotty/tools/dotc/semanticdb/PPrint.scala | 2 +- .../dotty/tools/dotc/semanticdb/Scala3.scala | 2 -- .../dotty/tools/dotc/semanticdb/Schema.scala | 1 - .../semanticdb/SemanticSymbolBuilder.scala | 1 - .../dotc/semanticdb/SyntheticsExtractor.scala | 1 - .../dotty/tools/dotc/semanticdb/Tools.scala | 2 +- .../dotty/tools/dotc/semanticdb/TypeOps.scala | 1 - .../dotc/semanticdb/internal/LiteParser.scala | 1 - .../SemanticdbGeneratedMessageCompanion.scala | 1 - .../tools/dotc/transform/AccessProxies.scala | 2 -- .../tools/dotc/transform/ArrayApply.scala | 3 --- .../dotc/transform/ArrayConstructors.scala | 1 - .../tools/dotc/transform/BeanProperties.scala | 1 - .../tools/dotc/transform/BetaReduce.scala | 1 - .../dotty/tools/dotc/transform/Bridges.scala | 1 - .../tools/dotc/transform/CapturedVars.scala | 2 -- .../transform/CheckLoopingImplicits.scala | 2 -- .../dotc/transform/CheckNoSuperThis.scala | 2 -- .../tools/dotc/transform/CheckStatic.scala | 1 - .../dotc/transform/CollectEntryPoints.scala | 6 ------ .../dotc/transform/CompleteJavaEnums.scala | 4 +--- .../tools/dotc/transform/Constructors.scala | 3 --- .../transform/ContextFunctionResults.scala | 1 - .../dotc/transform/CountOuterAccesses.scala | 2 -- .../tools/dotc/transform/Dependencies.scala | 1 - .../dotc/transform/DropOuterAccessors.scala | 2 -- .../tools/dotc/transform/ElimOpaque.scala | 3 --- .../tools/dotc/transform/ElimRepeated.scala | 3 --- .../dotty/tools/dotc/transform/Erasure.scala | 4 +--- .../tools/dotc/transform/EtaReduce.scala | 1 - .../tools/dotc/transform/ExpandPrivate.scala | 1 - .../tools/dotc/transform/ExpandSAMs.scala | 3 --- .../tools/dotc/transform/ExplicitOuter.scala | 1 - .../dotc/transform/ExtensionMethods.scala | 2 +- .../tools/dotc/transform/FirstTransform.scala | 2 -- .../dotc/transform/FullParameterization.scala | 2 -- .../dotc/transform/GenericSignatures.scala | 4 +--- .../dotty/tools/dotc/transform/Getters.scala | 1 - .../tools/dotc/transform/InlinePatterns.scala | 3 --- .../dotty/tools/dotc/transform/Inlining.scala | 18 ------------------ .../dotc/transform/Instrumentation.scala | 3 --- .../dotc/transform/InterceptedMethods.scala | 1 - .../tools/dotc/transform/LambdaLift.scala | 1 - .../tools/dotc/transform/LetOverApply.scala | 1 - .../tools/dotc/transform/MacroTransform.scala | 3 --- .../tools/dotc/transform/MegaPhase.scala | 1 - .../dotty/tools/dotc/transform/Memoize.scala | 2 -- .../dotty/tools/dotc/transform/Mixin.scala | 2 -- .../dotty/tools/dotc/transform/MixinOps.scala | 1 - .../tools/dotc/transform/MoveStatics.scala | 2 -- .../dotc/transform/NonLocalReturns.scala | 1 - .../dotc/transform/OverridingPairs.scala | 1 - .../dotc/transform/PCPCheckAndHeal.scala | 8 +------- .../dotc/transform/ParamForwarding.scala | 2 -- .../tools/dotc/transform/PatternMatcher.scala | 1 - .../tools/dotc/transform/PickleQuotes.scala | 5 +---- .../tools/dotc/transform/PostInlining.scala | 1 - .../dotc/transform/PruneErasedDefs.scala | 2 -- .../tools/dotc/transform/ResolveSuper.scala | 1 - .../tools/dotc/transform/RestoreScopes.scala | 2 -- .../tools/dotc/transform/SelectStatic.scala | 1 - .../tools/dotc/transform/SetRootTree.scala | 1 - .../dotc/transform/SpecializeFunctions.scala | 1 - .../dotty/tools/dotc/transform/Splicer.scala | 5 ++--- .../dotty/tools/dotc/transform/Staging.scala | 14 ++------------ .../tools/dotc/transform/SuperAccessors.scala | 2 -- .../dotty/tools/dotc/transform/SymUtils.scala | 2 -- .../dotty/tools/dotc/transform/TailRec.scala | 3 --- .../tools/dotc/transform/TreeChecker.scala | 1 - .../dotc/transform/TreeMapWithStages.scala | 13 +------------ .../dotc/transform/TryCatchPatterns.scala | 1 - .../dotc/transform/TupleOptimizations.scala | 4 ---- .../tools/dotc/transform/TypeTestsCasts.scala | 1 - .../dotc/transform/UncacheGivenAliases.scala | 4 ---- .../dotc/transform/UninitializedDefs.scala | 4 ---- .../dotc/transform/YCheckPositions.scala | 1 - .../tools/dotc/transform/init/Checker.scala | 1 - .../tools/dotc/transform/init/Semantic.scala | 1 - .../transform/localopt/FormatChecker.scala | 1 - .../localopt/StringInterpolatorOpt.scala | 2 -- .../tools/dotc/transform/patmat/Space.scala | 3 --- .../transform/sjs/AddLocalJSFakeNews.scala | 4 ---- .../transform/sjs/ExplicitJSClasses.scala | 5 ----- .../dotc/transform/sjs/JSExportUtils.scala | 17 ----------------- .../tools/dotc/transform/sjs/JSSymUtils.scala | 7 ------- .../transform/sjs/JUnitBootstrappers.scala | 3 --- .../dotc/transform/sjs/PrepJSExports.scala | 11 +---------- .../dotc/transform/sjs/PrepJSInterop.scala | 14 ++------------ .../dotty/tools/dotc/typer/Applications.scala | 11 ++++------- .../src/dotty/tools/dotc/typer/Checking.scala | 3 --- .../dotty/tools/dotc/typer/ConstFold.scala | 1 - .../src/dotty/tools/dotc/typer/Deriving.scala | 5 ----- .../src/dotty/tools/dotc/typer/Dynamic.scala | 1 - .../tools/dotc/typer/ErrorReporting.scala | 1 - .../dotty/tools/dotc/typer/EtaExpansion.scala | 2 -- .../dotty/tools/dotc/typer/Implicits.scala | 9 ++------- .../dotty/tools/dotc/typer/ImportInfo.scala | 3 --- .../tools/dotc/typer/ImportSuggestions.scala | 2 -- .../dotty/tools/dotc/typer/Inferencing.scala | 5 +---- .../src/dotty/tools/dotc/typer/Inliner.scala | 6 ++---- .../src/dotty/tools/dotc/typer/Namer.scala | 2 -- .../tools/dotc/typer/PrepareInlineable.scala | 4 +--- .../dotty/tools/dotc/typer/ProtoTypes.scala | 1 - .../tools/dotc/typer/QuotesAndSplices.scala | 9 +-------- .../src/dotty/tools/dotc/typer/ReTyper.scala | 3 +-- .../dotty/tools/dotc/typer/RefChecks.scala | 6 +----- .../dotty/tools/dotc/typer/Synthesizer.scala | 2 +- .../dotty/tools/dotc/typer/TypeAssigner.scala | 6 +----- .../src/dotty/tools/dotc/typer/Typer.scala | 4 +--- .../dotty/tools/dotc/typer/TyperPhase.scala | 10 +--------- .../tools/dotc/typer/VarianceChecker.scala | 1 - .../src/dotty/tools/dotc/util/EqHashMap.scala | 1 - .../src/dotty/tools/dotc/util/HashMap.scala | 1 - .../tools/dotc/util/NameTransformer.scala | 2 -- .../dotty/tools/dotc/util/ParsedComment.scala | 3 +-- .../dotty/tools/dotc/util/Signatures.scala | 3 --- .../dotty/tools/dotc/util/WeakHashSet.scala | 1 - compiler/src/dotty/tools/io/Jar.scala | 1 - .../tools/repl/CollectTopLevelImports.scala | 1 - compiler/src/dotty/tools/repl/Rendering.scala | 6 +----- .../src/dotty/tools/repl/ReplCompiler.scala | 5 ++--- .../src/dotty/tools/repl/ReplDriver.scala | 4 ++-- .../src/dotty/tools/repl/ScriptEngine.scala | 2 +- .../dotty/tools/runner/ScalaClassLoader.scala | 1 - .../tools/scripting/ScriptingDriver.scala | 1 - .../quoted/runtime/impl/QuoteMatcher.scala | 3 --- .../quoted/runtime/impl/QuotesImpl.scala | 3 +-- .../test/dotty/tools/CheckTypesTests.scala | 4 +--- compiler/test/dotty/tools/DottyTest.scala | 4 ---- .../test/dotty/tools/DottyTypeStealer.scala | 1 - .../tools/dotc/ast/AttachmentsTest.scala | 1 - .../dotty/tools/dotc/ast/DesugarTests.scala | 1 - .../dotty/tools/dotc/ast/TreeInfoTest.scala | 3 +-- .../dotc/config/CommandLineParserTest.scala | 2 +- .../dotc/core/SealedDescendantsTest.scala | 2 +- .../interactive/CustomCompletionTests.scala | 1 - .../tools/dotc/parsing/DeSugarTest.scala | 4 ---- .../tools/dotc/parsing/DocstringTests.scala | 1 - .../dotty/tools/dotc/parsing/ParserTest.scala | 2 -- .../tools/dotc/parsing/desugarPackage.scala | 1 - .../dotty/tools/dotc/parsing/showTree.scala | 5 ----- .../tools/dotc/printing/PrinterTests.scala | 3 +-- .../dotc/reporting/ErrorMessagesTest.scala | 1 - .../dotc/reporting/TestMessageLaziness.scala | 1 - .../tools/dotc/reporting/TestReporter.scala | 4 +--- .../CreateCompanionObjectsTest.scala | 11 +---------- .../tools/dotc/transform/LazyValsTest.scala | 2 -- .../transform/PostTyperTransformerTest.scala | 9 --------- .../transform/SpecializeFunctionsTests.scala | 4 ---- .../tools/dotc/typer/DivergenceChecker.scala | 6 +----- .../test/dotty/tools/repl/ScriptedTests.scala | 1 - .../tools/repl/ShadowingBatchTests.scala | 3 +-- 262 files changed, 119 insertions(+), 725 deletions(-) diff --git a/compiler/src/dotty/tools/MainGenericRunner.scala b/compiler/src/dotty/tools/MainGenericRunner.scala index b7ef90dcdc60..bcaa00b02133 100644 --- a/compiler/src/dotty/tools/MainGenericRunner.scala +++ b/compiler/src/dotty/tools/MainGenericRunner.scala @@ -3,17 +3,16 @@ package dotty.tools import scala.annotation.tailrec import scala.io.Source -import scala.util.{ Try, Success, Failure } +import scala.util.Try import java.io.File import java.lang.Thread import scala.annotation.internal.sharable import dotty.tools.dotc.util.ClasspathFromClassloader import dotty.tools.runner.ObjectRunner import dotty.tools.dotc.config.Properties.envOrNone -import java.util.jar._ import dotty.tools.io.Jar import dotty.tools.runner.ScalaClassLoader -import java.nio.file.{Files, Paths, Path} +import java.nio.file.Paths import dotty.tools.dotc.config.CommandLineParser import dotty.tools.scripting.StringDriver diff --git a/compiler/src/dotty/tools/backend/WorklistAlgorithm.scala b/compiler/src/dotty/tools/backend/WorklistAlgorithm.scala index fa0a5a96687c..b3d98d425b2a 100644 --- a/compiler/src/dotty/tools/backend/WorklistAlgorithm.scala +++ b/compiler/src/dotty/tools/backend/WorklistAlgorithm.scala @@ -1,8 +1,6 @@ package dotty.tools package backend -import scala.collection.mutable - /** * Simple implementation of a worklist algorithm. A processing * function is applied repeatedly to the first element in the diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeAsmCommon.scala b/compiler/src/dotty/tools/backend/jvm/BCodeAsmCommon.scala index 5fe63a8cfa61..e72d94fff82f 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeAsmCommon.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeAsmCommon.scala @@ -11,7 +11,7 @@ import dotty.tools.dotc.report * the compiler cake (Global). */ final class BCodeAsmCommon[I <: DottyBackendInterface](val interface: I) { - import interface.{_, given} + import interface.given import DottyBackendInterface.symExtensions /** diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala index 96ae4e8a00af..ed7a65000ce2 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala @@ -6,13 +6,12 @@ import scala.annotation.switch import scala.collection.mutable.SortedMap import scala.tools.asm -import scala.tools.asm.{Handle, Label, Opcodes} +import scala.tools.asm.{Handle, Opcodes} import BCodeHelpers.InvokeStyle import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.core.Constants._ -import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags.{Label => LabelFlag, _} import dotty.tools.dotc.core.Types._ import dotty.tools.dotc.core.StdNames.{nme, str} @@ -915,7 +914,6 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder { var default: asm.Label = null var indirectBlocks: List[(asm.Label, Tree)] = Nil - import scala.collection.mutable // Cases grouped by their hashCode val casesByHash = SortedMap.empty[Int, List[(String, Either[asm.Label, Tree])]] diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala b/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala index 4085d87ad7ca..3321a061325e 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala @@ -62,7 +62,6 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { @threadUnsafe lazy val JavaAnnotationClass: ClassSymbol = requiredClass("java.lang.annotation.Annotation") val bCodeAsmCommon: BCodeAsmCommon[int.type] = new BCodeAsmCommon(int) - import bCodeAsmCommon._ /* * must-single-thread @@ -479,7 +478,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { } // end of trait BCAnnotGen trait BCJGenSigGen { - import int.{_, given} + import int.given def getCurrentCUnit(): CompilationUnit diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala index fffefae8a165..c222f01518cc 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala @@ -4,7 +4,6 @@ package jvm import scala.tools.asm import scala.annotation.switch -import scala.collection.mutable import Primitives.{NE, EQ, TestOp, ArithmeticOp} import scala.tools.asm.tree.MethodInsnNode import dotty.tools.dotc.report diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index 86150f114d2c..8e4bec9acb8e 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -3,16 +3,12 @@ package backend package jvm import scala.collection.{ mutable, immutable } -import scala.annotation.switch import scala.tools.asm -import scala.tools.asm.util.{TraceMethodVisitor, ASMifier} -import java.io.PrintWriter import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.ast.TreeTypeMap import dotty.tools.dotc.CompilationUnit -import dotty.tools.dotc.core.Annotations.Annotation import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.StdNames._ diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSyncAndTry.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSyncAndTry.scala index d326bcfa242a..344c9bf22be8 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSyncAndTry.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSyncAndTry.scala @@ -9,7 +9,6 @@ import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.ast.tpd.TreeOps /* * @@ -18,7 +17,7 @@ import dotty.tools.dotc.ast.tpd.TreeOps * */ trait BCodeSyncAndTry extends BCodeBodyBuilder { - import int.{_, given} + import int.given import tpd._ import bTypes._ import coreBTypes._ diff --git a/compiler/src/dotty/tools/backend/jvm/BTypes.scala b/compiler/src/dotty/tools/backend/jvm/BTypes.scala index 8f4589aba83a..42f950af312b 100644 --- a/compiler/src/dotty/tools/backend/jvm/BTypes.scala +++ b/compiler/src/dotty/tools/backend/jvm/BTypes.scala @@ -15,7 +15,7 @@ import scala.tools.asm abstract class BTypes { val int: DottyBackendInterface - import int.{_, given} + import int.given /** * A map from internal names to ClassBTypes. Every ClassBType is added to this map on its * construction. diff --git a/compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala b/compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala index 2bf32030e987..1c721552485b 100644 --- a/compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala +++ b/compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala @@ -2,14 +2,11 @@ package dotty.tools package backend package jvm -import java.io.{ DataOutputStream, FileOutputStream, IOException, OutputStream, File => JFile } +import java.io.{ DataOutputStream, FileOutputStream, IOException, File as JFile } import java.nio.channels.ClosedByInterruptException -import java.nio.file.Files import dotty.tools.io._ import dotty.tools.dotc.report -import java.util.jar.Attributes.Name -import scala.language.postfixOps /** Can't output a file due to the state of the file system. */ class FileConflictException(msg: String, val file: AbstractFile) extends IOException(msg) diff --git a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala index 2e4905e7e3a3..88a2bf8faa35 100644 --- a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala +++ b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala @@ -2,9 +2,7 @@ package dotty.tools package backend package jvm -import scala.annotation.switch -import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.transform.Erasure @@ -33,7 +31,7 @@ import dotty.tools.dotc.transform.Erasure */ class CoreBTypes[BTFS <: BTypesFromSymbols[_ <: DottyBackendInterface]](val bTypes: BTFS) { import bTypes._ - import int.{_, given} + import int.given import DottyBackendInterface._ //import global._ @@ -212,7 +210,6 @@ trait CoreBTypesProxyGlobalIndependent[BTS <: BTypes] { */ final class CoreBTypesProxy[BTFS <: BTypesFromSymbols[_ <: DottyBackendInterface]](val bTypes: BTFS) extends CoreBTypesProxyGlobalIndependent[BTFS] { import bTypes._ - import bTypes.int._ private var _coreBTypes: CoreBTypes[bTypes.type] = _ def setBTypes(coreBTypes: CoreBTypes[BTFS]): Unit = { diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 64e667d95b68..b6392ec80b4e 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -1,38 +1,25 @@ package dotty.tools.backend.jvm import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.ast.Trees -import dotty.tools.dotc import dotty.tools.dotc.core.Flags._ -import dotty.tools.dotc.transform.{Erasure, GenericSignatures} import dotty.tools.dotc.transform.SymUtils._ import java.io.{File => _} -import scala.annotation.threadUnsafe -import scala.collection.generic.Clearable -import scala.collection.mutable import scala.reflect.ClassTag import dotty.tools.io.AbstractFile -import scala.tools.asm.AnnotationVisitor import dotty.tools.dotc.core._ import Contexts._ import Types._ import Symbols._ import Phases._ -import dotty.tools.dotc.util -import dotty.tools.dotc.util.{Spans, ReadOnlyMap} +import dotty.tools.dotc.util.ReadOnlyMap import dotty.tools.dotc.report -import Decorators._ -import Constants._ import tpd._ -import scala.tools.asm -import StdNames.{nme, str} -import NameKinds.{DefaultGetterName, ExpandedName, LazyBitMapName} -import Names.TermName -import Annotations.Annotation +import StdNames.nme +import NameKinds.LazyBitMapName import Names.Name class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap: ReadOnlyMap[Symbol, Set[ClassSymbol]])(using val ctx: Context) { diff --git a/compiler/src/dotty/tools/backend/jvm/GenBCode.scala b/compiler/src/dotty/tools/backend/jvm/GenBCode.scala index 2f2f653ae2e2..1bf0b697ef50 100644 --- a/compiler/src/dotty/tools/backend/jvm/GenBCode.scala +++ b/compiler/src/dotty/tools/backend/jvm/GenBCode.scala @@ -19,7 +19,6 @@ import dotty.tools.dotc.sbt.ExtractDependencies import Contexts._ import Phases._ import Symbols._ -import Decorators._ import java.io.DataOutputStream import java.nio.channels.ClosedByInterruptException diff --git a/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala b/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala index e1b6d8d922f7..2d4c3ce5c9c4 100644 --- a/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala +++ b/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala @@ -12,8 +12,6 @@ import dotc.report import dotc.util.ReadOnlyMap import scala.annotation.threadUnsafe -import scala.collection.immutable - /** Scala primitive operations are represented as methods in `Any` and * `AnyVal` subclasses. Here we demultiplex them by providing a mapping diff --git a/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala b/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala index 56e16647d080..901355945672 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala @@ -8,20 +8,15 @@ import dotty.tools.FatalError import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.core.Phases.Phase import dotty.tools.dotc.core._ -import Periods._ -import SymDenotations._ import Contexts._ import Decorators._ import Flags._ -import dotty.tools.dotc.ast.Trees._ import Names._ import NameKinds.DefaultGetterName import Types._ import Symbols._ -import Denotations._ import Phases._ import StdNames._ import TypeErasure.ErasedValueType @@ -29,7 +24,6 @@ import TypeErasure.ErasedValueType import dotty.tools.dotc.transform.{Erasure, ValueClasses} import dotty.tools.dotc.transform.SymUtils._ import dotty.tools.dotc.util.SourcePosition -import dotty.tools.dotc.util.Spans.Span import dotty.tools.dotc.report import org.scalajs.ir @@ -2580,7 +2574,6 @@ class JSCodeGen()(using genCtx: Context) { /** Gen JS code for a simple binary operation. */ private def genSimpleBinaryOp(tree: Apply, lhs: Tree, rhs: Tree, code: Int): js.Tree = { import dotty.tools.backend.ScalaPrimitivesOps._ - import js.UnaryOp._ implicit val pos: SourcePosition = tree.sourcePos diff --git a/compiler/src/dotty/tools/backend/sjs/JSDefinitions.scala b/compiler/src/dotty/tools/backend/sjs/JSDefinitions.scala index c02e0c030657..1b24a24101a1 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSDefinitions.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSDefinitions.scala @@ -6,9 +6,7 @@ import scala.annotation.threadUnsafe import Types._ import Contexts._ import Symbols._ -import Names._ import StdNames._ -import Decorators._ import dotty.tools.dotc.config.SJSPlatform diff --git a/compiler/src/dotty/tools/backend/sjs/JSEncoding.scala b/compiler/src/dotty/tools/backend/sjs/JSEncoding.scala index 55cb600182c7..a2b2fed93d83 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSEncoding.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSEncoding.scala @@ -1,20 +1,12 @@ package dotty.tools.backend.sjs -import scala.annotation.tailrec - import scala.collection.mutable -import dotty.tools.FatalError - import dotty.tools.dotc.core._ -import Decorators._ -import Periods._ -import SymDenotations._ import Contexts._ import Flags._ import Types._ import Symbols._ -import Denotations._ import NameOps._ import Names._ import StdNames._ @@ -28,9 +20,6 @@ import org.scalajs.ir.OriginalName import org.scalajs.ir.OriginalName.NoOriginalName import org.scalajs.ir.UTF8String -import ScopedVar.withScopedVars -import JSDefinitions._ - import dotty.tools.backend.jvm.DottyBackendInterface.symExtensions /** Encoding of symbol names for JavaScript diff --git a/compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala b/compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala index ab2211b7073b..3a9476d9638a 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala @@ -4,7 +4,6 @@ import scala.annotation.tailrec import scala.collection.mutable -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.core._ import Contexts._ @@ -14,23 +13,16 @@ import Flags._ import Names._ import NameKinds.DefaultGetterName import NameOps._ -import Periods._ import Phases._ -import StdNames._ import Symbols._ -import SymDenotations._ import Types._ import TypeErasure.ErasedValueType -import dotty.tools.dotc.transform.Erasure import dotty.tools.dotc.util.{SourcePosition, SrcPos} -import dotty.tools.dotc.util.Spans.Span import dotty.tools.dotc.report -import org.scalajs.ir -import org.scalajs.ir.{ClassKind, Position, Names => jsNames, Trees => js, Types => jstpe} -import org.scalajs.ir.Names.{ClassName, DefaultModuleID, MethodName, SimpleMethodName} -import org.scalajs.ir.OriginalName +import org.scalajs.ir.{Position, Names => jsNames, Trees => js, Types => jstpe} +import org.scalajs.ir.Names.DefaultModuleID import org.scalajs.ir.OriginalName.NoOriginalName import org.scalajs.ir.Position.NoPosition import org.scalajs.ir.Trees.OptimizerHints diff --git a/compiler/src/dotty/tools/backend/sjs/JSPrimitives.scala b/compiler/src/dotty/tools/backend/sjs/JSPrimitives.scala index ac7b492e3e1f..000ec334a127 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSPrimitives.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSPrimitives.scala @@ -2,7 +2,6 @@ package dotty.tools.backend.sjs import dotty.tools.dotc.core._ import Names.TermName -import StdNames._ import Types._ import Contexts._ import Symbols._ @@ -12,8 +11,6 @@ import dotty.tools.backend.jvm.DottyPrimitives import dotty.tools.dotc.report import dotty.tools.dotc.util.ReadOnlyMap -import scala.collection.mutable - object JSPrimitives { inline val FirstJSPrimitiveCode = 300 @@ -60,7 +57,6 @@ object JSPrimitives { class JSPrimitives(ictx: Context) extends DottyPrimitives(ictx) { import JSPrimitives._ - import dotty.tools.backend.ScalaPrimitivesOps._ private lazy val jsPrimitives: ReadOnlyMap[Symbol, Int] = initJSPrimitives(using ictx) diff --git a/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala b/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala index 4ce4030fb440..be5b8e7bb416 100644 --- a/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala +++ b/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala @@ -1,7 +1,5 @@ package dotty.tools.backend.sjs -import language.implicitConversions - class ScopedVar[A](init: A) { import ScopedVar.Assignment diff --git a/compiler/src/dotty/tools/dotc/CompilationUnit.scala b/compiler/src/dotty/tools/dotc/CompilationUnit.scala index 3c73b1126889..413d616f108d 100644 --- a/compiler/src/dotty/tools/dotc/CompilationUnit.scala +++ b/compiler/src/dotty/tools/dotc/CompilationUnit.scala @@ -9,7 +9,6 @@ import util.{FreshNameCreator, SourceFile, NoSource} import util.Spans.Span import ast.{tpd, untpd} import tpd.{Tree, TreeTraverser} -import typer.PrepareInlineable.InlineAccessors import typer.Nullables import transform.SymUtils._ import core.Decorators._ diff --git a/compiler/src/dotty/tools/dotc/Driver.scala b/compiler/src/dotty/tools/dotc/Driver.scala index 17177e72a7de..81331ce06e9b 100644 --- a/compiler/src/dotty/tools/dotc/Driver.scala +++ b/compiler/src/dotty/tools/dotc/Driver.scala @@ -1,19 +1,15 @@ package dotty.tools.dotc -import java.nio.file.{Files, Paths} - import dotty.tools.FatalError import config.CompilerCommand import core.Comments.{ContextDoc, ContextDocstrings} import core.Contexts._ -import core.{MacroClassLoader, Mode, TypeError} -import core.StdNames.nme +import core.{MacroClassLoader, TypeError} import dotty.tools.dotc.ast.Positioned import dotty.tools.io.AbstractFile import reporting._ import core.Decorators._ import config.Feature -import util.SourceFile import scala.util.control.NonFatal import fromtasty.{TASTYCompiler, TastyFileUtil} diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala index a258036466ff..3c48e737cff8 100644 --- a/compiler/src/dotty/tools/dotc/Run.scala +++ b/compiler/src/dotty/tools/dotc/Run.scala @@ -5,18 +5,17 @@ import core._ import Contexts._ import Periods._ import Symbols._ -import Types._ import Scopes._ import Names.Name import Denotations.Denotation -import typer.{Typer, PrepareInlineable} -import typer.ImportInfo._ +import typer.Typer +import typer.ImportInfo.withRootImports import Decorators._ -import io.{AbstractFile, PlainFile, VirtualFile} +import io.{AbstractFile, VirtualFile} import Phases.unfusedPhases import util._ -import reporting.{Reporter, Suppression, Action} +import reporting.{Suppression, Action} import reporting.Diagnostic import reporting.Diagnostic.Warning import rewrites.Rewrites diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 9c8201b4fa02..5b9eeabecf4f 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -4,10 +4,10 @@ package ast import core._ import util.Spans._, Types._, Contexts._, Constants._, Names._, NameOps._, Flags._ -import Symbols._, StdNames._, Trees._, Phases._, ContextOps._ +import Symbols._, StdNames._, Trees._, ContextOps._ import Decorators._, transform.SymUtils._ import NameKinds.{UniqueName, EvidenceParamName, DefaultGetterName} -import typer.{TyperPhase, Namer, Checking} +import typer.{Namer, Checking} import util.{Property, SourceFile, SourcePosition} import config.Feature.{sourceVersion, migrateTo3, enabled} import config.SourceVersion._ diff --git a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala index 009aba09f2f6..b86d87a41889 100644 --- a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala +++ b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala @@ -3,7 +3,7 @@ package dotc package ast import core._ -import util.Spans._, Types._, Contexts._, Constants._, Names._, NameOps._, Flags._ +import util.Spans._, Types._, Contexts._, Constants._, Names._, Flags._ import Symbols._, StdNames._, Trees._ import Decorators._ import util.{Property, SourceFile} diff --git a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala index 2eafeca16e39..ea41984c5766 100644 --- a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala +++ b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala @@ -2,9 +2,8 @@ package dotty.tools.dotc package ast import core._ -import Symbols._, Types._, Contexts._, Decorators._, util.Spans._, Flags._, Constants._ +import Symbols._, Types._, Contexts._, Flags._, Constants._ import StdNames.nme -import ast.Trees._ /** Generate proxy classes for @main functions. * A function like diff --git a/compiler/src/dotty/tools/dotc/ast/NavigateAST.scala b/compiler/src/dotty/tools/dotc/ast/NavigateAST.scala index 730149381487..bcedc4dfa50b 100644 --- a/compiler/src/dotty/tools/dotc/ast/NavigateAST.scala +++ b/compiler/src/dotty/tools/dotc/ast/NavigateAST.scala @@ -5,7 +5,6 @@ import core.Contexts._ import core.Decorators._ import util.Spans._ import Trees.{MemberDef, DefTree, WithLazyField} -import dotty.tools.dotc.core.Annotations.ConcreteAnnotation import dotty.tools.dotc.core.Types.AnnotatedType import dotty.tools.dotc.core.Types.ImportType import dotty.tools.dotc.core.Types.Type diff --git a/compiler/src/dotty/tools/dotc/ast/Positioned.scala b/compiler/src/dotty/tools/dotc/ast/Positioned.scala index 964b9855ae13..ded6db413e55 100644 --- a/compiler/src/dotty/tools/dotc/ast/Positioned.scala +++ b/compiler/src/dotty/tools/dotc/ast/Positioned.scala @@ -3,7 +3,7 @@ package dotc package ast import util.Spans._ -import util.{SourceFile, NoSource, SourcePosition, SrcPos} +import util.{SourceFile, SourcePosition, SrcPos} import core.Contexts._ import core.Decorators._ import core.NameOps._ @@ -12,9 +12,6 @@ import core.StdNames.nme import ast.Trees.mods import annotation.constructorOnly import annotation.internal.sharable -import reporting.Reporter - -import java.io.{ PrintWriter } /** A base class for things that have positions (currently: modifiers and trees) */ diff --git a/compiler/src/dotty/tools/dotc/ast/TreeMapWithImplicits.scala b/compiler/src/dotty/tools/dotc/ast/TreeMapWithImplicits.scala index 3f4ff4687787..47ae2086ae74 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeMapWithImplicits.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeMapWithImplicits.scala @@ -8,8 +8,6 @@ import core.Flags._ import core.Symbols._ import core.TypeError -import scala.annotation.tailrec - /** A TreeMap that maintains the necessary infrastructure to support * contextual implicit searches (type-scope implicits are supported anyway). * diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index 7aa4491c31de..c4a791a579b8 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -6,7 +6,6 @@ import core._ import Types._, Names._, NameOps._, Flags._, util.Spans._, Contexts._, Constants._ import typer.{ ConstFold, ProtoTypes } import SymDenotations._, Symbols._, Denotations._, StdNames._, Comments._ -import language.higherKinds import collection.mutable.ListBuffer import printing.Printer import printing.Texts.Text diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala index 5845773fe65b..2082fcf630ac 100644 --- a/compiler/src/dotty/tools/dotc/ast/tpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala @@ -12,12 +12,11 @@ import util.Spans._, Types._, Contexts._, Constants._, Names._, Flags._, NameOps import Symbols._, StdNames._, Annotations._, Trees._, Symbols._ import Decorators._, DenotTransformers._ import collection.{immutable, mutable} -import util.{Property, SourceFile, NoSource} +import util.{Property, SourceFile} import NameKinds.{TempResultName, OuterSelectName} import typer.ConstFold import scala.annotation.tailrec -import scala.io.Codec /** Some creators for typed trees */ object tpd extends Trees.Instance[Type] with TypedTreeInfo { diff --git a/compiler/src/dotty/tools/dotc/ast/untpd.scala b/compiler/src/dotty/tools/dotc/ast/untpd.scala index 7e00972f354d..4905290c86b2 100644 --- a/compiler/src/dotty/tools/dotc/ast/untpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/untpd.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.typer.ProtoTypes import Symbols._, StdNames._, Trees._ import util.{Property, SourceFile, NoSource} import util.Spans.Span -import language.higherKinds import annotation.constructorOnly import annotation.internal.sharable import Decorators._ diff --git a/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala b/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala index 99ea4f25ff49..eb689b8b2950 100644 --- a/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala +++ b/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala @@ -13,7 +13,6 @@ import scala.annotation.tailrec import dotty.tools.io.{AbstractFile, ClassPath, ClassRepresentation, FileZipArchive, ManifestResources} import dotty.tools.dotc.core.Contexts._ import FileUtils._ -import util._ /** * A trait providing an optional cache for classpath entries obtained from zip and jar files. diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index 5a648db2b504..dc503705d81b 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -1,11 +1,8 @@ package dotty.tools.dotc package config -import java.nio.file.{Files, Paths} - import Settings._ import core.Contexts._ -import Properties._ import scala.PartialFunction.cond diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 29a02b7f7a29..41e123472a75 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -1,13 +1,8 @@ package dotty.tools.dotc package config -import java.nio.file.{Files, Paths} - import Settings._ import core.Contexts._ -import Properties._ - -import scala.collection.JavaConverters._ abstract class CompilerCommand extends CliCommand: type ConcreteSettings = ScalaSettings diff --git a/compiler/src/dotty/tools/dotc/config/Config.scala b/compiler/src/dotty/tools/dotc/config/Config.scala index ac1708378e73..b9a8c96f49d9 100644 --- a/compiler/src/dotty/tools/dotc/config/Config.scala +++ b/compiler/src/dotty/tools/dotc/config/Config.scala @@ -1,5 +1,4 @@ package dotty.tools.dotc.config -import annotation.internal.sharable object Config { diff --git a/compiler/src/dotty/tools/dotc/config/Feature.scala b/compiler/src/dotty/tools/dotc/config/Feature.scala index ed592e76ace1..d72131161d25 100644 --- a/compiler/src/dotty/tools/dotc/config/Feature.scala +++ b/compiler/src/dotty/tools/dotc/config/Feature.scala @@ -3,9 +3,9 @@ package dotc package config import core._ -import Contexts._, Symbols._, Names._, NameOps._, Phases._ +import Contexts._, Symbols._, Names._ import StdNames.nme -import Decorators.{_, given} +import Decorators.* import util.{SrcPos, NoSourcePosition} import SourceVersion._ import reporting.Message @@ -122,4 +122,4 @@ object Feature: def isExperimentalEnabled(using Context): Boolean = Properties.experimental && !ctx.settings.YnoExperimental.value -end Feature \ No newline at end of file +end Feature diff --git a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala index 36bedd8db3db..2b2f35e49451 100644 --- a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala +++ b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala @@ -5,7 +5,7 @@ package config import io._ import classpath.AggregateClassPath import core._ -import Symbols._, Types._, Contexts._, SymDenotations._, StdNames._ +import Symbols._, Types._, Contexts._, StdNames._ import Flags._ import transform.ExplicitOuter, transform.SymUtils._ diff --git a/compiler/src/dotty/tools/dotc/config/PathResolver.scala b/compiler/src/dotty/tools/dotc/config/PathResolver.scala index e98552a9df28..ae7cd314972c 100644 --- a/compiler/src/dotty/tools/dotc/config/PathResolver.scala +++ b/compiler/src/dotty/tools/dotc/config/PathResolver.scala @@ -7,7 +7,6 @@ import io.{ClassPath, Directory, Path} import classpath.{AggregateClassPath, ClassPathFactory, JrtClassPath} import ClassPath.split import PartialFunction.condOpt -import scala.language.postfixOps import core.Contexts._ import Settings._ import dotty.tools.io.File diff --git a/compiler/src/dotty/tools/dotc/config/Platform.scala b/compiler/src/dotty/tools/dotc/config/Platform.scala index a39b801ed39b..0faacf1bcebb 100644 --- a/compiler/src/dotty/tools/dotc/config/Platform.scala +++ b/compiler/src/dotty/tools/dotc/config/Platform.scala @@ -5,7 +5,6 @@ package config import io.{ClassPath, AbstractFile} import core.Contexts._, core.Symbols._ import core.SymbolLoader -import core.SymDenotations.SymDenotation import core.StdNames.nme import core.Flags.Module diff --git a/compiler/src/dotty/tools/dotc/config/SJSPlatform.scala b/compiler/src/dotty/tools/dotc/config/SJSPlatform.scala index 98dae40c3504..0275e0d6a227 100644 --- a/compiler/src/dotty/tools/dotc/config/SJSPlatform.scala +++ b/compiler/src/dotty/tools/dotc/config/SJSPlatform.scala @@ -3,12 +3,9 @@ package dotty.tools.dotc.config import dotty.tools.dotc.core._ import Contexts._ import Symbols._ -import SymDenotations._ import dotty.tools.backend.sjs.JSDefinitions -import org.scalajs.ir.Trees.JSNativeLoadSpec - object SJSPlatform { /** The `SJSPlatform` for the current context. */ def sjsPlatform(using Context): SJSPlatform = diff --git a/compiler/src/dotty/tools/dotc/config/Settings.scala b/compiler/src/dotty/tools/dotc/config/Settings.scala index 29a52defa4c6..dea34bbc263d 100644 --- a/compiler/src/dotty/tools/dotc/config/Settings.scala +++ b/compiler/src/dotty/tools/dotc/config/Settings.scala @@ -7,7 +7,6 @@ import dotty.tools.io.{AbstractFile, Directory, JarArchive, PlainDirectory} import annotation.tailrec import collection.mutable.ArrayBuffer -import language.existentials import reflect.ClassTag import scala.util.{Success, Failure} diff --git a/compiler/src/dotty/tools/dotc/config/SourceVersion.scala b/compiler/src/dotty/tools/dotc/config/SourceVersion.scala index 7311beb07601..466e503e1a66 100644 --- a/compiler/src/dotty/tools/dotc/config/SourceVersion.scala +++ b/compiler/src/dotty/tools/dotc/config/SourceVersion.scala @@ -2,10 +2,7 @@ package dotty.tools package dotc package config -import core.Contexts._ -import core.Names.TermName -import core.StdNames.nme -import core.Decorators.{_, given} +import core.Decorators.* import util.Property enum SourceVersion: diff --git a/compiler/src/dotty/tools/dotc/core/Annotations.scala b/compiler/src/dotty/tools/dotc/core/Annotations.scala index b8d62210ce26..a6c424ef13db 100644 --- a/compiler/src/dotty/tools/dotc/core/Annotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Annotations.scala @@ -1,11 +1,8 @@ package dotty.tools.dotc package core -import Symbols._, Types._, Contexts._, Constants._, ast.tpd._, Phases._ -import config.ScalaVersion -import StdNames._ -import dotty.tools.dotc.ast.tpd -import scala.util.Try +import Symbols._, Types._, Contexts._, Constants._ +import dotty.tools.dotc.ast.tpd, tpd.* import util.Spans.Span import printing.{Showable, Printer} import printing.Texts.Text @@ -30,7 +27,7 @@ object Annotations { if (tree eq this.tree) this else Annotation(tree) /** All arguments to this annotation in a single flat list */ - def arguments(using Context): List[Tree] = ast.tpd.allArguments(tree) + def arguments(using Context): List[Tree] = tpd.allArguments(tree) def argument(i: Int)(using Context): Option[Tree] = { val args = arguments diff --git a/compiler/src/dotty/tools/dotc/core/Comments.scala b/compiler/src/dotty/tools/dotc/core/Comments.scala index 183b581ce2e7..969cf76dc3fa 100644 --- a/compiler/src/dotty/tools/dotc/core/Comments.scala +++ b/compiler/src/dotty/tools/dotc/core/Comments.scala @@ -3,7 +3,7 @@ package dotc package core import ast.{ untpd, tpd } -import Decorators._, Symbols._, Contexts._ +import Symbols._, Contexts._ import util.{SourceFile, ReadOnlyMap} import util.Spans._ import util.CommentParsing._ diff --git a/compiler/src/dotty/tools/dotc/core/Constants.scala b/compiler/src/dotty/tools/dotc/core/Constants.scala index f2e6f6fc489a..63baf50fae02 100644 --- a/compiler/src/dotty/tools/dotc/core/Constants.scala +++ b/compiler/src/dotty/tools/dotc/core/Constants.scala @@ -5,7 +5,6 @@ package core import Types._, Symbols._, Contexts._ import printing.Printer import printing.Texts.Text -import Decorators._ object Constants { diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index 835da2176a33..aded1cede9b4 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -9,9 +9,7 @@ import Decorators._ import Flags._ import config.Config import config.Printers.typr -import reporting.trace import typer.ProtoTypes.{newTypeVar, representedParamRef} -import StdNames.tpnme import UnificationDirection.* import NameKinds.AvoidNameKind diff --git a/compiler/src/dotty/tools/dotc/core/ContextOps.scala b/compiler/src/dotty/tools/dotc/core/ContextOps.scala index 594f103b8481..b7fd43735dd0 100644 --- a/compiler/src/dotty/tools/dotc/core/ContextOps.scala +++ b/compiler/src/dotty/tools/dotc/core/ContextOps.scala @@ -1,7 +1,7 @@ package dotty.tools.dotc package core -import Contexts._, Symbols._, Types._, Flags._, Scopes._, Decorators._, NameOps._ +import Contexts._, Symbols._, Types._, Flags._ import Denotations._, SymDenotations._ import Names.Name, StdNames.nme import ast.untpd @@ -110,4 +110,4 @@ object ContextOps: if (pkg.is(Package)) ctx.fresh.setOwner(pkg.moduleClass).setTree(tree) else ctx } -end ContextOps \ No newline at end of file +end ContextOps diff --git a/compiler/src/dotty/tools/dotc/core/Decorators.scala b/compiler/src/dotty/tools/dotc/core/Decorators.scala index 3ea05af0292a..6f823ba5cc7a 100644 --- a/compiler/src/dotty/tools/dotc/core/Decorators.scala +++ b/compiler/src/dotty/tools/dotc/core/Decorators.scala @@ -4,12 +4,9 @@ package core import annotation.tailrec import Symbols._ -import Contexts._, Names._, Phases._, printing.Texts._, printing.Printer -import util.Spans.Span +import Contexts._, Names._, Phases._, printing.Texts._ import collection.mutable.ListBuffer import dotty.tools.dotc.transform.MegaPhase -import ast.tpd._ -import scala.language.implicitConversions import printing.Formatting._ /** This object provides useful implicit decorators for types defined elsewhere */ diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 794119cd7a79..76e6918f214d 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -8,7 +8,6 @@ import Flags._, Scopes._, Decorators._, NameOps._, Periods._, NullOpsDecorator._ import unpickleScala2.Scala2Unpickler.ensureConstructor import scala.collection.mutable import collection.mutable -import Denotations.SingleDenotation import util.{SimpleIdentityMap, SourceFile, NoSource} import typer.ImportInfo.RootRef import Comments.CommentsContext diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index d97ae8ca2f6e..a5e1f64d58cb 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -18,7 +18,6 @@ import Signature.MatchDegree._ import printing.Texts._ import printing.Printer import io.AbstractFile -import config.Feature.migrateTo3 import config.Config import config.Printers.overload import util.common._ diff --git a/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala b/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala index fb1ed9acaa4f..c49b5e888904 100644 --- a/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala +++ b/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala @@ -11,7 +11,6 @@ import collection.mutable import printing._ import scala.annotation.internal.sharable -import scala.annotation.unused /** Represents GADT constraints currently in scope */ sealed abstract class GadtConstraint extends Showable { diff --git a/compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala b/compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala index acd0088f09aa..60fc4a4274e0 100644 --- a/compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala +++ b/compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala @@ -1,10 +1,8 @@ package dotty.tools.dotc package core -import config.Feature._ import Contexts._ import Flags.JavaDefined -import NullOpsDecorator._ import StdNames.nme import Symbols._ import Types._ diff --git a/compiler/src/dotty/tools/dotc/core/MacroClassLoader.scala b/compiler/src/dotty/tools/dotc/core/MacroClassLoader.scala index e56835d59c54..a65abe56edb9 100644 --- a/compiler/src/dotty/tools/dotc/core/MacroClassLoader.scala +++ b/compiler/src/dotty/tools/dotc/core/MacroClassLoader.scala @@ -5,8 +5,6 @@ import dotty.tools.dotc.util.Property import dotty.tools.dotc.reporting.trace import dotty.tools.io.ClassPath -import scala.collection.mutable - object MacroClassLoader { /** A key to be used in a context property that caches the class loader used for macro expansion */ diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index fb35ac0ac91f..21d44d9a4daa 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -10,7 +10,6 @@ import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._ import util.Chars.{isOperatorPart, digit2int} import Definitions._ import nme._ -import Decorators._ object NameOps { diff --git a/compiler/src/dotty/tools/dotc/core/NamerOps.scala b/compiler/src/dotty/tools/dotc/core/NamerOps.scala index 9444270ccb05..f55b0665abcc 100644 --- a/compiler/src/dotty/tools/dotc/core/NamerOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NamerOps.scala @@ -3,10 +3,7 @@ package dotc package core import Contexts._, Symbols._, Types._, Flags._, Scopes._, Decorators._, Names._, NameOps._ -import Denotations._ import SymDenotations.{LazyType, SymDenotation}, StdNames.nme -import config.Config -import ast.untpd /** Operations that are shared between Namer and TreeUnpickler */ object NamerOps: diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index f12aaecdd12d..23c2441ba728 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -7,8 +7,6 @@ import util.NameTransformer import printing.{Showable, Texts, Printer} import Texts.Text import StdNames.str -import util.Chars.isIdentifierStart -import collection.immutable import config.Config import util.{LinearMap, HashSet} diff --git a/compiler/src/dotty/tools/dotc/core/NullOpsDecorator.scala b/compiler/src/dotty/tools/dotc/core/NullOpsDecorator.scala index d0799ca89d24..e18271772ff1 100644 --- a/compiler/src/dotty/tools/dotc/core/NullOpsDecorator.scala +++ b/compiler/src/dotty/tools/dotc/core/NullOpsDecorator.scala @@ -1,9 +1,7 @@ package dotty.tools.dotc package core -import ast.Trees._ import Contexts._ -import Symbols.defn import Types._ /** Defines operations on nullable types and tree. */ @@ -59,4 +57,4 @@ object NullOpsDecorator: case OrNull(tp) => self.cast(tp) case _ => self } -end NullOpsDecorator \ No newline at end of file +end NullOpsDecorator diff --git a/compiler/src/dotty/tools/dotc/core/Scopes.scala b/compiler/src/dotty/tools/dotc/core/Scopes.scala index ecc61530601d..44b97a25503e 100644 --- a/compiler/src/dotty/tools/dotc/core/Scopes.scala +++ b/compiler/src/dotty/tools/dotc/core/Scopes.scala @@ -14,11 +14,10 @@ import Names._ import Contexts._ import Phases._ import Denotations._ -import SymDenotations._ import printing.Texts._ import printing.Printer -import util.common._ import SymDenotations.NoDenotation + import collection.mutable object Scopes { diff --git a/compiler/src/dotty/tools/dotc/core/StagingContext.scala b/compiler/src/dotty/tools/dotc/core/StagingContext.scala index 9fbb009f6e5f..4a4f451df099 100644 --- a/compiler/src/dotty/tools/dotc/core/StagingContext.scala +++ b/compiler/src/dotty/tools/dotc/core/StagingContext.scala @@ -2,15 +2,10 @@ package dotty.tools.dotc.core import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ -import dotty.tools.dotc.core.Types._ -import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.util.Property import dotty.tools.dotc.transform.PCPCheckAndHeal -import scala.collection.mutable - object StagingContext { /** A key to be used in a context property that tracks the quoteation level */ diff --git a/compiler/src/dotty/tools/dotc/core/StdNames.scala b/compiler/src/dotty/tools/dotc/core/StdNames.scala index f8c70176482c..01a3306b8fe8 100644 --- a/compiler/src/dotty/tools/dotc/core/StdNames.scala +++ b/compiler/src/dotty/tools/dotc/core/StdNames.scala @@ -1,7 +1,6 @@ package dotty.tools.dotc package core -import scala.language.implicitConversions import scala.collection.mutable import scala.annotation.switch import Names._ diff --git a/compiler/src/dotty/tools/dotc/core/Substituters.scala b/compiler/src/dotty/tools/dotc/core/Substituters.scala index f00edcb189c6..bc292d4724a6 100644 --- a/compiler/src/dotty/tools/dotc/core/Substituters.scala +++ b/compiler/src/dotty/tools/dotc/core/Substituters.scala @@ -1,6 +1,6 @@ package dotty.tools.dotc.core -import Types._, Symbols._, Contexts._, Decorators._ +import Types._, Symbols._, Contexts._ /** Substitution operations on types. See the corresponding `subst` and * `substThis` methods on class Type for an explanation. diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 5c3545bb2f65..96c629517719 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -12,7 +12,7 @@ import Scopes.Scope import dotty.tools.io.AbstractFile import Decorators._ import ast._ -import ast.Trees.{LambdaTypeTree, TypeBoundsTree, ValDef, TypeDef} +import ast.Trees.{LambdaTypeTree, TypeBoundsTree} import Trees.Literal import Variances.Variance import annotation.tailrec @@ -23,7 +23,6 @@ import scala.util.control.NonFatal import config.Config import reporting._ import collection.mutable -import transform.TypeUtils._ import scala.annotation.internal.sharable diff --git a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala index 83198ab65857..597cf1dc76b0 100644 --- a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala +++ b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala @@ -5,7 +5,6 @@ package core import java.io.{IOException, File} import java.nio.channels.ClosedByInterruptException -import scala.compat.Platform.currentTime import scala.util.control.NonFatal import dotty.tools.io.{ ClassPath, ClassRepresentation, AbstractFile } @@ -19,9 +18,7 @@ import Decorators._ import util.Stats import reporting.trace -import config.Config -import ast.Trees._ import ast.desugar import parsing.JavaParsers.OutlineJavaParser diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index 4fb481dfe2a9..75db5f7c04e9 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -7,7 +7,6 @@ import Names._ import Scopes._ import Flags._ import Decorators._ -import Symbols._ import Contexts._ import Phases._ import SymDenotations._ @@ -25,13 +24,11 @@ import ast.tpd import tpd.{Tree, TreeProvider, TreeOps} import ast.TreeTypeMap import Constants.Constant -import Variances.{Variance, varianceFromInt} +import Variances.Variance import reporting.Message import collection.mutable import io.AbstractFile -import language.implicitConversions import util.{SourceFile, NoSource, Property, SourcePosition, SrcPos, EqHashMap} -import scala.collection.JavaConverters._ import scala.annotation.internal.sharable import config.Printers.typr diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 95ad0b95b335..da1817090d7a 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -9,9 +9,7 @@ import SymDenotations.LazyType import Decorators._ import util.Stats._ import Names._ -import NameOps._ import Flags.Module -import Variances.variancesConform import dotty.tools.dotc.config.Config object TypeApplications { diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 9e71e362a345..777a569e8d36 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -11,7 +11,7 @@ import collection.mutable import util.Stats import config.Config import config.Feature.migrateTo3 -import config.Printers.{constr, subtyping, gadts, matchTypes, noPrinter} +import config.Printers.{subtyping, gadts, matchTypes, noPrinter} import TypeErasure.{erasedLub, erasedGlb} import TypeApplications._ import Variances.{Variance, variancesConform} @@ -22,7 +22,6 @@ import scala.util.control.NonFatal import typer.ProtoTypes.constrained import typer.Applications.productSelectorTypes import reporting.trace -import NullOpsDecorator._ import annotation.constructorOnly /** Provides methods to compare types. diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index 2d5c2a6da88a..cd570b57d3b3 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -10,15 +10,12 @@ import Decorators._ import StdNames._ import collection.mutable import ast.tpd._ -import reporting.{trace, Message} -import config.Printers.{gadts, typr} +import reporting.trace +import config.Printers.typr import config.Feature -import typer.Applications._ import typer.ProtoTypes._ import typer.ForceDegree import typer.Inferencing._ -import typer.IfBottom -import reporting.TestingReporter import scala.annotation.internal.sharable import scala.annotation.threadUnsafe diff --git a/compiler/src/dotty/tools/dotc/core/TyperState.scala b/compiler/src/dotty/tools/dotc/core/TyperState.scala index 6163eebfbef4..a537234208a1 100644 --- a/compiler/src/dotty/tools/dotc/core/TyperState.scala +++ b/compiler/src/dotty/tools/dotc/core/TyperState.scala @@ -4,7 +4,7 @@ package core import Types._ import Contexts._ -import util.{SimpleIdentityMap, SimpleIdentitySet} +import util.SimpleIdentitySet import reporting._ import config.Config import config.Printers.constr diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index e9eb8ed78d02..4fd3e6770194 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package core -import util.common._ import Symbols._ import Flags._ import Names._ @@ -19,7 +18,7 @@ import Decorators._ import Denotations._ import Periods._ import CheckRealizable._ -import Variances.{Variance, varianceFromInt, varianceToInt, setStructuralVariances, Invariant} +import Variances.{Variance, setStructuralVariances, Invariant} import typer.Nullables import util.Stats._ import util.SimpleIdentitySet @@ -31,9 +30,7 @@ import Hashable._ import Uniques._ import collection.mutable import config.Config -import config.Feature import annotation.{tailrec, constructorOnly} -import language.implicitConversions import scala.util.hashing.{ MurmurHash3 => hashing } import config.Printers.{core, typr, matchTypes} import reporting.{trace, Message} diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 9920fc060142..c96141a73676 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -3,18 +3,16 @@ package dotc package core package classfile -import dotty.tools.tasty.{ TastyFormat, TastyReader, TastyHeaderUnpickler } +import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler } import Contexts._, Symbols._, Types._, Names._, StdNames._, NameOps._, Scopes._, Decorators._ import SymDenotations._, unpickleScala2.Scala2Unpickler._, Constants._, Annotations._, util.Spans._ import Phases._ -import NameKinds.DefaultGetterName import ast.{ tpd, untpd } import ast.tpd._, util._ -import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, DataInputStream, IOException } +import java.io.{ ByteArrayOutputStream, IOException } import java.lang.Integer.toHexString -import java.net.URLClassLoader import java.util.UUID import scala.collection.immutable @@ -22,7 +20,7 @@ import scala.collection.mutable.{ ListBuffer, ArrayBuffer } import scala.annotation.switch import tasty.TastyVersion import typer.Checking.checkNonCyclic -import io.{AbstractFile, PlainFile, ZipArchive} +import io.{AbstractFile, ZipArchive} import scala.util.control.NonFatal object ClassfileParser { diff --git a/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala index 068def1abdbd..2fd75516ad70 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala @@ -1,8 +1,7 @@ package dotty.tools.dotc.core.tasty import dotty.tools.dotc.ast.{tpd, untpd} -import dotty.tools.dotc.core.Comments.{Comment, CommentsContext, ContextDocstrings} -import dotty.tools.dotc.core.Contexts._ +import dotty.tools.dotc.core.Comments.Comment import dotty.tools.tasty.TastyBuffer import TastyBuffer.{Addr, NoAddr} diff --git a/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala b/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala index e09b2b74fc9e..623508780325 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/NameBuffer.scala @@ -10,7 +10,6 @@ import collection.mutable import Names.{Name, chrs, SimpleName, DerivedName, TypeName} import NameKinds._ import NameOps._ -import Decorators._ import scala.io.Codec import NameTags.{SIGNED, TARGETSIGNED} diff --git a/compiler/src/dotty/tools/dotc/core/tasty/PositionUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/PositionUnpickler.scala index 782a6ac3a598..9c66e43eae80 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/PositionUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/PositionUnpickler.scala @@ -8,7 +8,6 @@ import TastyFormat.SOURCE import TastyBuffer.{Addr, NameRef} import util.Spans._ -import collection.{mutable, Map} import Names.TermName /** Unpickler for tree positions */ diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala index 0a05cd8edc4a..c938868a3c48 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala @@ -6,11 +6,9 @@ import dotty.tools.tasty.{TastyBuffer, TastyReader} import TastyBuffer.NameRef import Contexts._, Decorators._ -import Names.{Name, TermName} +import Names.TermName import StdNames.nme import TastyUnpickler._ -import util.Spans.offsetToInt -import printing.Highlighting._ import dotty.tools.tasty.TastyFormat.ASTsSection /** Reads the package and class name of the class contained in this TASTy */ diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala index 74b8b357e00c..f4654022f38c 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala @@ -10,8 +10,7 @@ import TastyBuffer._ import Contexts._ import collection.mutable -import core.Symbols.{Symbol, ClassSymbol} -import ast.tpd +import core.Symbols.ClassSymbol import Decorators._ object TastyPickler { diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala index d1c9904cf6cb..f8c93c27c086 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala @@ -3,13 +3,12 @@ package core package tasty import dotty.tools.tasty.{TastyBuffer, TastyReader} -import TastyBuffer.{Addr, NameRef} +import TastyBuffer.NameRef import Contexts._, Decorators._ import Names.Name import TastyUnpickler._ import util.Spans.offsetToInt -import printing.Highlighting._ import dotty.tools.tasty.TastyFormat.{ASTsSection, PositionsSection, CommentsSection} import java.nio.file.{Files, Paths} import dotty.tools.io.{JarArchive, Path} diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 8f5910c3dd56..c8bffbc17252 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -9,16 +9,10 @@ import dotty.tools.tasty.TastyBuffer._ import ast.Trees._ import ast.{untpd, tpd} import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annotations._, Flags._ -import Denotations.MultiDenotation import Comments.{Comment, CommentsContext} -import typer.Inliner import NameKinds._ import StdNames.nme import transform.SymUtils._ -import printing.Printer -import printing.Texts._ -import util.SourceFile -import annotation.constructorOnly import collection.mutable import dotty.tools.tasty.TastyFormat.ASTsSection diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index ac315f4cef89..475e8dccd997 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -5,7 +5,6 @@ package tasty import Comments.CommentsContext import Contexts._ -import Phases._ import Symbols._ import Types._ import Scopes._ @@ -27,10 +26,9 @@ import typer.Checking.checkNonCyclic import typer.Nullables._ import util.Spans._ import util.SourceFile -import ast.{TreeTypeMap, Trees, tpd, untpd} +import ast.{Trees, tpd, untpd} import Trees._ import Decorators._ -import transform.SymUtils._ import dotty.tools.tasty.{TastyBuffer, TastyReader} import TastyBuffer._ @@ -39,11 +37,9 @@ import scala.annotation.{switch, tailrec} import scala.collection.mutable.ListBuffer import scala.collection.mutable import config.Printers.pickling -import quoted.PickledQuotes import dotty.tools.tasty.TastyFormat._ -import scala.quoted import scala.annotation.constructorOnly import scala.annotation.internal.sharable diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala index f43735d16630..f2d25d0f34b5 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala @@ -5,7 +5,6 @@ package unpickleScala2 import Symbols._, Types._, Contexts._, Flags._, Names._, StdNames._, Phases._ import Decorators._ -import backend.sjs.JSDefinitions import scala.collection.mutable.ListBuffer /** Erasure logic specific to Scala 2 symbols. */ diff --git a/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala b/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala index 55e6e54787a2..c66a16dbb7b5 100644 --- a/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala +++ b/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala @@ -8,7 +8,6 @@ import scala.io.Codec import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Phases.Phase -import dotty.tools.dotc.core.tasty.TastyPrinter import dotty.tools.io.File import scala.quoted.runtime.impl.QuotesImpl diff --git a/compiler/src/dotty/tools/dotc/fromtasty/TASTYCompiler.scala b/compiler/src/dotty/tools/dotc/fromtasty/TASTYCompiler.scala index 59f8444eb06a..923892b62f13 100644 --- a/compiler/src/dotty/tools/dotc/fromtasty/TASTYCompiler.scala +++ b/compiler/src/dotty/tools/dotc/fromtasty/TASTYCompiler.scala @@ -5,7 +5,6 @@ package fromtasty import core._ import Contexts._ import Phases.Phase -import dotty.tools.dotc.transform._ class TASTYCompiler extends Compiler { diff --git a/compiler/src/dotty/tools/dotc/interactive/Completion.scala b/compiler/src/dotty/tools/dotc/interactive/Completion.scala index 1f26b50b6cce..1192bead245c 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Completion.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Completion.scala @@ -1,27 +1,21 @@ package dotty.tools.dotc.interactive -import java.nio.charset.Charset -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.config.Printers.interactiv import dotty.tools.dotc.core.Contexts._ -import dotty.tools.dotc.core.CheckRealizable import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Names.{Name, TermName} import dotty.tools.dotc.core.NameKinds.SimpleNameKind import dotty.tools.dotc.core.NameOps._ -import dotty.tools.dotc.core.Symbols.{NoSymbol, Symbol, TermSymbol, defn, newSymbol} -import dotty.tools.dotc.core.Scopes.Scope -import dotty.tools.dotc.core.StdNames.{nme, tpnme} +import dotty.tools.dotc.core.Symbols.{Symbol, defn} +import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.SymDenotations.SymDenotation -import dotty.tools.dotc.core.TypeComparer import dotty.tools.dotc.core.TypeError -import dotty.tools.dotc.core.Types.{ExprType, MethodOrPoly, NameFilter, NamedType, NoType, PolyType, TermRef, Type} -import dotty.tools.dotc.printing.Texts._ -import dotty.tools.dotc.util.{NameTransformer, NoSourcePosition, SourcePosition} +import dotty.tools.dotc.core.Types.{ExprType, MethodOrPoly, NameFilter, NoType, TermRef, Type} +import dotty.tools.dotc.util.SourcePosition import scala.collection.mutable import scala.util.control.NonFatal diff --git a/compiler/src/dotty/tools/dotc/interactive/Interactive.scala b/compiler/src/dotty/tools/dotc/interactive/Interactive.scala index cb41650c0b57..219d9f5384ba 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Interactive.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Interactive.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package interactive -import scala.annotation.tailrec import scala.collection._ import ast.{NavigateAST, Trees, tpd, untpd} @@ -11,10 +10,6 @@ import Decorators._, ContextOps._ import Contexts._, Flags._, Names._, NameOps._, Symbols._, Trees._, Types._ import transform.SymUtils._ import util.Spans._, util.SourceFile, util.SourcePosition -import core.Denotations.SingleDenotation -import NameKinds.SimpleNameKind -import config.Printers.interactiv -import StdNames.nme /** High-level API to get information out of typed trees, designed to be used by IDEs. * diff --git a/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala b/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala index c0584c51b842..e17866130e3d 100644 --- a/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala +++ b/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala @@ -12,7 +12,7 @@ import java.util.zip._ import scala.collection._ import scala.io.Codec -import dotty.tools.io.{ AbstractFile, ClassPath, ClassRepresentation, PlainFile, VirtualFile } +import dotty.tools.io.{ AbstractFile, VirtualFile } import ast.{Trees, tpd} import core._, core.Decorators._ diff --git a/compiler/src/dotty/tools/dotc/interactive/SourceTree.scala b/compiler/src/dotty/tools/dotc/interactive/SourceTree.scala index e77a8aab36b6..60f01396e91e 100644 --- a/compiler/src/dotty/tools/dotc/interactive/SourceTree.scala +++ b/compiler/src/dotty/tools/dotc/interactive/SourceTree.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package interactive -import scala.io.Codec import ast.tpd import core._ diff --git a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala index e5b0b24bdd2f..f5f016d740d2 100644 --- a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala @@ -14,7 +14,6 @@ import core._ import Contexts._ import Names._ import Types._ -import Symbols._ import ast.Trees._ import Decorators._ import StdNames._ diff --git a/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala b/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala index d5918b5179ca..a67bca34cae2 100644 --- a/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala +++ b/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala @@ -1,11 +1,8 @@ package dotty.tools.dotc.parsing -import dotty.tools.dotc.ast.Trees import dotty.tools.dotc.config.Config -import dotty.tools.dotc.config.Printers.{ default, typr } import dotty.tools.dotc.core.Contexts.{ Context, ctx } import dotty.tools.dotc.core.Phases.Phase -import dotty.tools.dotc.core.Symbols.defn import dotty.tools.dotc.typer.ImportInfo.withRootImports import dotty.tools.dotc.{ CompilationUnit, ast, report } import dotty.tools.dotc.util.{ NoSourcePosition, SourcePosition } diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 366ed459a6a0..820d13cb0e9f 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -17,15 +17,14 @@ import NameKinds.WildcardParamName import NameOps._ import ast.{Positioned, Trees} import ast.Trees._ -import typer.ImportInfo import StdNames._ import util.Spans._ import Constants._ -import Symbols.{defn, NoSymbol} +import Symbols.NoSymbol import ScriptParsers._ import Decorators._ import util.Chars -import scala.annotation.{tailrec, switch} +import scala.annotation.tailrec import rewrites.Rewrites.{patch, overlapsPatch} import reporting._ import config.Feature diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index 72b05ad073c2..209092b5d1a7 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -5,22 +5,17 @@ package parsing import core.Names._, core.Contexts._, core.Decorators._, util.Spans._ import core.StdNames._, core.Comments._ import util.SourceFile -import java.lang.Character.isDigit import util.Chars._ import util.{SourcePosition, CharBuffer} import util.Spans.Span import config.Config -import config.Printers.lexical -import config.Settings.Setting import Tokens._ import scala.annotation.{switch, tailrec} import scala.collection.mutable -import scala.collection.immutable.{SortedMap, BitSet} +import scala.collection.immutable.SortedMap import rewrites.Rewrites.patch import config.Feature import config.Feature.migrateTo3 -import config.SourceVersion._ -import reporting.Message object Scanners { diff --git a/compiler/src/dotty/tools/dotc/plugins/Plugin.scala b/compiler/src/dotty/tools/dotc/plugins/Plugin.scala index 76cf60d5e3be..f7391a1b711b 100644 --- a/compiler/src/dotty/tools/dotc/plugins/Plugin.scala +++ b/compiler/src/dotty/tools/dotc/plugins/Plugin.scala @@ -10,7 +10,6 @@ import transform.MegaPhase.MiniPhase import java.io.InputStream import java.util.Properties -import scala.collection.mutable import scala.util.{ Try, Success, Failure } trait PluginPhase extends MiniPhase { diff --git a/compiler/src/dotty/tools/dotc/printing/DecompilerPrinter.scala b/compiler/src/dotty/tools/dotc/printing/DecompilerPrinter.scala index bd1cc574cf27..83dc32d6e7ac 100644 --- a/compiler/src/dotty/tools/dotc/printing/DecompilerPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/DecompilerPrinter.scala @@ -9,7 +9,6 @@ import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.StdNames._ -import dotty.tools.dotc.core.Annotations.Annotation class DecompilerPrinter(_ctx: Context) extends RefinedPrinter(_ctx) { diff --git a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala index cf5942a178f0..544fdcad2ae0 100644 --- a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -16,18 +16,16 @@ import Denotations._ import SymDenotations._ import StdNames.{nme, tpnme} import ast.{Trees, untpd} -import typer.{Implicits, Namer, Applications} +import typer.{Implicits, Namer} import typer.ProtoTypes._ import Trees._ import TypeApplications._ -import Decorators._ import NameKinds.{WildcardParamName, DefaultGetterName} import util.Chars.isOperatorPart import transform.TypeUtils._ import transform.SymUtils._ -import language.implicitConversions -import dotty.tools.dotc.util.{NameTransformer, SourcePosition} +import dotty.tools.dotc.util.SourcePosition import dotty.tools.dotc.ast.untpd.{MemberDef, Modifiers, PackageDef, RefTree, Template, TypeDef, ValOrDefDef} class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { @@ -845,7 +843,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { paramss.foldLeft(leading)((txt, params) => txt ~ paramsText(params)) protected def valDefToText[T >: Untyped](tree: ValDef[T]): Text = { - import untpd._ dclTextOr(tree) { modText(tree.mods, tree.symbol, keywordStr(if (tree.mods.is(Mutable)) "var" else "val"), isType = false) ~~ valDefText(nameIdText(tree)) ~ optAscription(tree.tpt) ~ diff --git a/compiler/src/dotty/tools/dotc/printing/Texts.scala b/compiler/src/dotty/tools/dotc/printing/Texts.scala index 9a3aac39ed18..0cab82a76a6d 100644 --- a/compiler/src/dotty/tools/dotc/printing/Texts.scala +++ b/compiler/src/dotty/tools/dotc/printing/Texts.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc package printing -import language.implicitConversions object Texts { diff --git a/compiler/src/dotty/tools/dotc/quoted/MacroExpansion.scala b/compiler/src/dotty/tools/dotc/quoted/MacroExpansion.scala index 628afe4504bd..141b349826b4 100644 --- a/compiler/src/dotty/tools/dotc/quoted/MacroExpansion.scala +++ b/compiler/src/dotty/tools/dotc/quoted/MacroExpansion.scala @@ -1,10 +1,9 @@ package dotty.tools.dotc.quoted import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.core._ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.typer.Typer -import dotty.tools.dotc.util.{Property, SourcePosition, Spans} +import dotty.tools.dotc.util.{Property, SourcePosition} object MacroExpansion { diff --git a/compiler/src/dotty/tools/dotc/quoted/PickledQuotes.scala b/compiler/src/dotty/tools/dotc/quoted/PickledQuotes.scala index 8c72177a76d0..c76bb593875b 100644 --- a/compiler/src/dotty/tools/dotc/quoted/PickledQuotes.scala +++ b/compiler/src/dotty/tools/dotc/quoted/PickledQuotes.scala @@ -3,11 +3,8 @@ package dotty.tools.dotc.quoted import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.{TreeTypeMap, tpd} import dotty.tools.dotc.config.Printers._ -import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.core.StdNames._ -import dotty.tools.dotc.core.NameKinds import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Types._ @@ -16,7 +13,6 @@ import dotty.tools.dotc.core.tasty.DottyUnpickler import dotty.tools.dotc.core.tasty.TreeUnpickler.UnpickleMode import dotty.tools.dotc.report -import scala.reflect.ClassTag import scala.quoted.Quotes import scala.quoted.runtime.impl._ diff --git a/compiler/src/dotty/tools/dotc/quoted/QuoteUtils.scala b/compiler/src/dotty/tools/dotc/quoted/QuoteUtils.scala index 56c8d3347205..604c8da3420a 100644 --- a/compiler/src/dotty/tools/dotc/quoted/QuoteUtils.scala +++ b/compiler/src/dotty/tools/dotc/quoted/QuoteUtils.scala @@ -1,9 +1,7 @@ package dotty.tools.dotc.quoted -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ -import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Symbols._ object QuoteUtils: diff --git a/compiler/src/dotty/tools/dotc/quoted/QuotesCache.scala b/compiler/src/dotty/tools/dotc/quoted/QuotesCache.scala index 996eb8a76fbb..c063e437cb19 100644 --- a/compiler/src/dotty/tools/dotc/quoted/QuotesCache.scala +++ b/compiler/src/dotty/tools/dotc/quoted/QuotesCache.scala @@ -2,10 +2,8 @@ package dotty.tools.dotc.quoted import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.util.Property -import dotty.tools.dotc.reporting.trace import dotty.tools.dotc.ast.tpd -import scala.collection.mutable object QuotesCache { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/quoted/TastyString.scala b/compiler/src/dotty/tools/dotc/quoted/TastyString.scala index 677c742c41df..528414654969 100644 --- a/compiler/src/dotty/tools/dotc/quoted/TastyString.scala +++ b/compiler/src/dotty/tools/dotc/quoted/TastyString.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc.quoted -import java.io._ import java.util.Base64 import java.nio.charset.StandardCharsets.UTF_8 diff --git a/compiler/src/dotty/tools/dotc/quoted/reflect/FromSymbol.scala b/compiler/src/dotty/tools/dotc/quoted/reflect/FromSymbol.scala index 30071ea374fa..87d0cbb7be08 100644 --- a/compiler/src/dotty/tools/dotc/quoted/reflect/FromSymbol.scala +++ b/compiler/src/dotty/tools/dotc/quoted/reflect/FromSymbol.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Types._ -import dotty.tools.dotc.core.Decorators._ object FromSymbol { diff --git a/compiler/src/dotty/tools/dotc/reporting/ConsoleReporter.scala b/compiler/src/dotty/tools/dotc/reporting/ConsoleReporter.scala index 0d2292318a71..a95af962c053 100644 --- a/compiler/src/dotty/tools/dotc/reporting/ConsoleReporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/ConsoleReporter.scala @@ -4,7 +4,7 @@ package reporting import core.Contexts._ import java.io.{ BufferedReader, PrintWriter } -import Diagnostic.{ Error, ConditionalWarning } +import Diagnostic.Error /** * This class implements a Reporter that displays messages on a text console diff --git a/compiler/src/dotty/tools/dotc/reporting/Message.scala b/compiler/src/dotty/tools/dotc/reporting/Message.scala index cd7456cafcc2..f309dc0f1477 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Message.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Message.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package reporting import scala.annotation.threadUnsafe -import util.SourcePosition object Message { val nonSensicalStartTag: String = "" diff --git a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala index 421d8f52b43a..39ece915ca83 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala @@ -2,9 +2,7 @@ package dotty.tools package dotc package reporting -import dotty.tools.dotc.ast.{Trees, tpd} import dotty.tools.dotc.core.Contexts._ -import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Symbols.{NoSymbol, Symbol} import dotty.tools.dotc.reporting.Diagnostic._ @@ -14,7 +12,6 @@ import dotty.tools.dotc.util.NoSourcePosition import java.io.{BufferedReader, PrintWriter} import scala.annotation.internal.sharable import scala.collection.mutable -import scala.util.chaining._ object Reporter { /** Convert a SimpleReporter into a real Reporter */ diff --git a/compiler/src/dotty/tools/dotc/reporting/WConf.scala b/compiler/src/dotty/tools/dotc/reporting/WConf.scala index 34a47fa3db9d..01c2e79389c6 100644 --- a/compiler/src/dotty/tools/dotc/reporting/WConf.scala +++ b/compiler/src/dotty/tools/dotc/reporting/WConf.scala @@ -7,7 +7,6 @@ import dotty.tools.dotc.util.SourcePosition import java.util.regex.PatternSyntaxException import scala.annotation.internal.sharable -import scala.collection.mutable.ListBuffer import scala.util.matching.Regex enum MessageFilter: diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index 4a1efab782a1..0262e0190677 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -8,7 +8,6 @@ import Decorators._, Symbols._, Names._, NameOps._, Types._, Flags._, Phases._ import Denotations.SingleDenotation import SymDenotations.SymDenotation import NameKinds.WildcardParamName -import util.SourcePosition import parsing.Scanners.Token import parsing.Tokens import printing.Highlighting._ diff --git a/compiler/src/dotty/tools/dotc/sbt/APIUtils.scala b/compiler/src/dotty/tools/dotc/sbt/APIUtils.scala index d61718799b20..9ddb8aa9116c 100644 --- a/compiler/src/dotty/tools/dotc/sbt/APIUtils.scala +++ b/compiler/src/dotty/tools/dotc/sbt/APIUtils.scala @@ -2,13 +2,8 @@ package dotty.tools.dotc package sbt import core._ -import Annotations._ import Contexts._ -import Decorators._ -import Denotations._ import Flags._ -import Phases._ -import Types._ import Symbols._ import NameOps._ diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 3e442aab5b68..feef706d3c15 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc package sbt import ExtractDependencies.internalError -import ast.{Positioned, Trees, tpd, untpd} +import ast.{Positioned, Trees, tpd} import core._ import core.Decorators._ import Annotations._ @@ -14,14 +14,12 @@ import Types._ import Symbols._ import Names._ import NameOps._ -import NameKinds.DefaultGetterName import typer.Inliner import transform.ValueClasses import transform.SymUtils._ import dotty.tools.io.File import java.io.PrintWriter -import xsbti.api.DefinitionType import scala.collection.mutable import scala.util.hashing.MurmurHash3 diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index 0dd30cd27ced..83fb4fd40215 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -4,7 +4,6 @@ package sbt import java.io.File import java.util.{Arrays, EnumSet} -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ @@ -12,7 +11,6 @@ import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.NameOps._ import dotty.tools.dotc.core.Names._ import dotty.tools.dotc.core.Phases._ -import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Denotations.StaleSymbol import dotty.tools.dotc.core.Types._ diff --git a/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala b/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala index e40607ef0d5a..140d2fe5b766 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala @@ -5,7 +5,6 @@ package semanticdb import core._ import Phases._ import ast.tpd._ -import ast.untpd.given import ast.Trees.{mods, WithEndMarker} import Contexts._ import Symbols._ @@ -15,10 +14,9 @@ import StdNames.nme import NameOps._ import Denotations.StaleSymbol import util.Spans.Span -import util.{SourceFile, SourcePosition} +import util.SourceFile import transform.SymUtils._ -import scala.jdk.CollectionConverters._ import scala.collection.mutable import scala.annotation.{ threadUnsafe => tu, tailrec } import scala.PartialFunction.condOpt @@ -32,7 +30,6 @@ import dotty.tools.dotc.{semanticdb => s} */ class ExtractSemanticDB extends Phase: import Scala3.{_, given} - import Symbols.given override val phaseName: String = ExtractSemanticDB.name @@ -458,7 +455,6 @@ class ExtractSemanticDB extends Phase: object ExtractSemanticDB: import java.nio.file.Path - import scala.collection.JavaConverters._ import java.nio.file.Files import java.nio.file.Paths diff --git a/compiler/src/dotty/tools/dotc/semanticdb/Language.scala b/compiler/src/dotty/tools/dotc/semanticdb/Language.scala index 7007f29816db..54473f87a938 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/Language.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/Language.scala @@ -6,7 +6,6 @@ package dotty.tools.dotc.semanticdb import dotty.tools.dotc.semanticdb.internal._ -import scala.annotation.internal.sharable sealed abstract class Language(val value: _root_.scala.Int) extends SemanticdbGeneratedEnum derives CanEqual { type EnumType = Language diff --git a/compiler/src/dotty/tools/dotc/semanticdb/PPrint.scala b/compiler/src/dotty/tools/dotc/semanticdb/PPrint.scala index 4361db3e50d6..17c66ebcc49c 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/PPrint.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/PPrint.scala @@ -3,7 +3,7 @@ package dotty.tools.dotc.semanticdb import dotty.tools.dotc.{semanticdb => s} import scala.collection.mutable -import dotty.tools.dotc.semanticdb.Scala3.{_, given} +import dotty.tools.dotc.semanticdb.Scala3.given import SymbolInformation.Kind._ import dotty.tools.dotc.util.SourceFile class SymbolInformationPrinter (symtab: PrinterSymtab): diff --git a/compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala b/compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala index 686dc20e481b..45af208b3e36 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala @@ -12,8 +12,6 @@ import core.StdNames.nme import SymbolInformation.{Kind => k} import dotty.tools.dotc.util.SourceFile import dotty.tools.dotc.util.Spans.Span -import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.{semanticdb => s} import java.lang.Character.{isJavaIdentifierPart, isJavaIdentifierStart} diff --git a/compiler/src/dotty/tools/dotc/semanticdb/Schema.scala b/compiler/src/dotty/tools/dotc/semanticdb/Schema.scala index 492e1647de51..edebcc8c0412 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/Schema.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/Schema.scala @@ -6,7 +6,6 @@ package dotty.tools.dotc.semanticdb import dotty.tools.dotc.semanticdb.internal._ -import scala.annotation.internal.sharable sealed abstract class Schema(val value: _root_.scala.Int) extends SemanticdbGeneratedEnum derives CanEqual { type EnumType = Schema diff --git a/compiler/src/dotty/tools/dotc/semanticdb/SemanticSymbolBuilder.scala b/compiler/src/dotty/tools/dotc/semanticdb/SemanticSymbolBuilder.scala index 8743fd04d651..c825032373f8 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/SemanticSymbolBuilder.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/SemanticSymbolBuilder.scala @@ -10,7 +10,6 @@ import Names.Name import scala.annotation.tailrec import scala.collection.mutable -import dotty.tools.dotc.core.Types.TypeParamRef class SemanticSymbolBuilder: import Scala3.{_, given} diff --git a/compiler/src/dotty/tools/dotc/semanticdb/SyntheticsExtractor.scala b/compiler/src/dotty/tools/dotc/semanticdb/SyntheticsExtractor.scala index 0818b7cf1be1..c5bd6cc7863b 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/SyntheticsExtractor.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/SyntheticsExtractor.scala @@ -6,7 +6,6 @@ import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.{semanticdb => s} -import scala.collection.mutable class SyntheticsExtractor: import Scala3.{_, given} diff --git a/compiler/src/dotty/tools/dotc/semanticdb/Tools.scala b/compiler/src/dotty/tools/dotc/semanticdb/Tools.scala index 54b57f7c6a2f..d7d3324549b7 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/Tools.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/Tools.scala @@ -4,7 +4,7 @@ import java.nio.file._ import java.nio.charset.StandardCharsets import scala.collection.JavaConverters._ import dotty.tools.dotc.util.SourceFile -import dotty.tools.dotc.semanticdb.Scala3.{_, given} +import dotty.tools.dotc.semanticdb.Scala3.given object Tools: diff --git a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala index 963a153388a3..8983a3c61634 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala @@ -9,7 +9,6 @@ import core.Annotations.Annotation import core.Flags import core.Names.Name import core.StdNames.tpnme -import ast.tpd._ import scala.util.chaining.scalaUtilChainingOps import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/semanticdb/internal/LiteParser.scala b/compiler/src/dotty/tools/dotc/semanticdb/internal/LiteParser.scala index dea43c0ede19..1000fc6601da 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/internal/LiteParser.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/internal/LiteParser.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc.semanticdb.internal -import java.io.InputStream object LiteParser { diff --git a/compiler/src/dotty/tools/dotc/semanticdb/internal/SemanticdbGeneratedMessageCompanion.scala b/compiler/src/dotty/tools/dotc/semanticdb/internal/SemanticdbGeneratedMessageCompanion.scala index 4974e3ea256c..bad0ff9b8fc8 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/internal/SemanticdbGeneratedMessageCompanion.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/internal/SemanticdbGeneratedMessageCompanion.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc.semanticdb.internal -import java.io.InputStream // https://github.com/scalapb/ScalaPB/blob/194463272125b872b99d4902b7712355a53e96c4/scalapb-runtime/src/main/scala/scalapb/GeneratedMessageCompanion.scala#L61-L68 trait SemanticdbGeneratedOneof extends Any with Product with Serializable { diff --git a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala index de25cb140da0..15c6d30c3b19 100644 --- a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala +++ b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala @@ -11,8 +11,6 @@ import NameOps._ import Decorators._ import TypeUtils._ import Types._ -import NameKinds.ClassifiedNameKind -import ast.Trees._ import util.Spans.Span import config.Printers.transforms diff --git a/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala b/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala index cc39c5a3517b..872c7cc897de 100644 --- a/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala +++ b/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala @@ -5,13 +5,10 @@ import core._ import MegaPhase._ import Contexts._ import Symbols._ -import Types._ import Flags._ import StdNames._ -import ast.Trees._ import dotty.tools.dotc.ast.tpd -import scala.reflect.ClassTag /** This phase rewrites calls to `Array.apply` to a direct instantiation of the array in the bytecode. diff --git a/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala b/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala index 1bcaa2626ee3..2b02e94e4f0f 100644 --- a/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala +++ b/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala @@ -7,7 +7,6 @@ import Contexts._ import Symbols._ import Types._ import StdNames._ -import ast.Trees._ import dotty.tools.dotc.ast.tpd diff --git a/compiler/src/dotty/tools/dotc/transform/BeanProperties.scala b/compiler/src/dotty/tools/dotc/transform/BeanProperties.scala index 91ec94590284..0d464d319848 100644 --- a/compiler/src/dotty/tools/dotc/transform/BeanProperties.scala +++ b/compiler/src/dotty/tools/dotc/transform/BeanProperties.scala @@ -5,7 +5,6 @@ import core._ import ast.tpd._ import Annotations._ import Contexts._ -import SymDenotations._ import Symbols.newSymbol import Decorators._ import Flags._ diff --git a/compiler/src/dotty/tools/dotc/transform/BetaReduce.scala b/compiler/src/dotty/tools/dotc/transform/BetaReduce.scala index 79b68b331930..90c0207ebb6d 100644 --- a/compiler/src/dotty/tools/dotc/transform/BetaReduce.scala +++ b/compiler/src/dotty/tools/dotc/transform/BetaReduce.scala @@ -7,7 +7,6 @@ import Flags._ import MegaPhase._ import Symbols._, Contexts._, Types._, Decorators._ import StdNames.nme -import ast.Trees._ import ast.TreeTypeMap /** Rewrite an application diff --git a/compiler/src/dotty/tools/dotc/transform/Bridges.scala b/compiler/src/dotty/tools/dotc/transform/Bridges.scala index f7c00ef74b94..912b8ca69131 100644 --- a/compiler/src/dotty/tools/dotc/transform/Bridges.scala +++ b/compiler/src/dotty/tools/dotc/transform/Bridges.scala @@ -7,7 +7,6 @@ import Symbols._, Types._, Contexts._, Decorators._, Flags._, Scopes._, Phases._ import DenotTransformers._ import ast.untpd import collection.{mutable, immutable} -import util.Spans.Span import util.SrcPos import ContextFunctionResults.{contextResultCount, contextFunctionResultTypeAfter} import StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala index 2969b00c7dd2..d3efa6c60d5c 100644 --- a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala +++ b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala @@ -11,9 +11,7 @@ import core.StdNames.nme import core.Names._ import core.NameKinds.TempResultName import core.Constants._ -import ast.Trees._ import util.Store -import collection.mutable /** This phase translates variables that are captured in closures to * heap-allocated refs. diff --git a/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala b/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala index 074f5a634821..70c8c0314658 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala @@ -5,10 +5,8 @@ import core.* import MegaPhase.MiniPhase import Contexts.*, Types.*, Symbols.*, SymDenotations.*, Flags.* import ast.* -import Trees.* import Decorators.* -import annotation.threadUnsafe object CheckLoopingImplicits: val name: String = "checkLoopingImplicits" diff --git a/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala b/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala index 5d11cbdf7bb5..f43d000bbf44 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala @@ -5,10 +5,8 @@ import core.* import MegaPhase.MiniPhase import Contexts.*, Types.*, Symbols.*, SymDenotations.*, Flags.* import ast.* -import Trees.* import Decorators.* -import annotation.threadUnsafe object CheckNoSuperThis: val name: String = "checkNoSuperThis" diff --git a/compiler/src/dotty/tools/dotc/transform/CheckStatic.scala b/compiler/src/dotty/tools/dotc/transform/CheckStatic.scala index ddd42d615ad4..0d5154e212ee 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckStatic.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckStatic.scala @@ -7,7 +7,6 @@ import Flags._ import Contexts._ import Symbols._ import dotty.tools.dotc.ast.tpd -import Decorators._ import reporting._ import dotty.tools.dotc.transform.SymUtils._ diff --git a/compiler/src/dotty/tools/dotc/transform/CollectEntryPoints.scala b/compiler/src/dotty/tools/dotc/transform/CollectEntryPoints.scala index de304f5d3077..b4544b2225dd 100644 --- a/compiler/src/dotty/tools/dotc/transform/CollectEntryPoints.scala +++ b/compiler/src/dotty/tools/dotc/transform/CollectEntryPoints.scala @@ -2,19 +2,13 @@ package dotty.tools.dotc.transform import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.Context -import dotty.tools.dotc.core.Types import dotty.tools.dotc.transform.MegaPhase._ import java.io.{File => _} import dotty.tools.dotc.core._ -import SymDenotations._ import Contexts._ -import Types._ import Symbols._ import Phases._ -import dotty.tools.dotc.util.SourcePosition -import Decorators._ -import StdNames.nme import dotty.tools.io.JarArchive import dotty.tools.backend.jvm.GenBCode diff --git a/compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala b/compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala index 9f90ae43c751..be454281bcbb 100644 --- a/compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala +++ b/compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala @@ -4,7 +4,7 @@ package transform import core._ import Names._ -import StdNames.{nme, tpnme} +import StdNames.nme import Types._ import dotty.tools.dotc.transform.MegaPhase._ import Flags._ @@ -13,10 +13,8 @@ import Symbols._ import Constants._ import Decorators._ import DenotTransformers._ -import dotty.tools.dotc.ast.Trees._ import SymUtils._ -import annotation.threadUnsafe object CompleteJavaEnums { val name: String = "completeJavaEnums" diff --git a/compiler/src/dotty/tools/dotc/transform/Constructors.scala b/compiler/src/dotty/tools/dotc/transform/Constructors.scala index be77103e2395..a897165ac671 100644 --- a/compiler/src/dotty/tools/dotc/transform/Constructors.scala +++ b/compiler/src/dotty/tools/dotc/transform/Constructors.scala @@ -3,11 +3,9 @@ package transform import core._ import MegaPhase._ -import dotty.tools.dotc.ast.tpd._ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.StdNames._ import ast._ -import Trees._ import Flags._ import Names.Name import NameOps._ @@ -16,7 +14,6 @@ import SymUtils._ import Symbols._ import Decorators._ import DenotTransformers._ -import Constants.Constant import collection.mutable object Constructors { diff --git a/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala b/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala index 14134b4bb1fa..be58fb41f1da 100644 --- a/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala +++ b/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala @@ -8,7 +8,6 @@ import StdNames.nme import ast.untpd import ast.tpd._ import config.Config -import Decorators.* object ContextFunctionResults: diff --git a/compiler/src/dotty/tools/dotc/transform/CountOuterAccesses.scala b/compiler/src/dotty/tools/dotc/transform/CountOuterAccesses.scala index 54ac7478c332..91b5bc6a3de4 100644 --- a/compiler/src/dotty/tools/dotc/transform/CountOuterAccesses.scala +++ b/compiler/src/dotty/tools/dotc/transform/CountOuterAccesses.scala @@ -5,10 +5,8 @@ import core._ import MegaPhase.MiniPhase import dotty.tools.dotc.core.Contexts._ import ast._ -import Trees._ import Flags._ import Symbols._ -import Decorators._ import ExplicitOuter.isOuterParamAccessor import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/transform/Dependencies.scala b/compiler/src/dotty/tools/dotc/transform/Dependencies.scala index c5c6c5baaa7b..6f781c85a027 100644 --- a/compiler/src/dotty/tools/dotc/transform/Dependencies.scala +++ b/compiler/src/dotty/tools/dotc/transform/Dependencies.scala @@ -3,7 +3,6 @@ package transform import core.* import Symbols.*, Contexts.*, Types.*, Flags.*, Decorators.* -import ast.Trees.* import SymUtils.* import collection.mutable.{LinkedHashMap, TreeSet} import annotation.constructorOnly diff --git a/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala b/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala index e9322a450cb9..ca6a056fd6d5 100644 --- a/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala +++ b/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala @@ -5,7 +5,6 @@ import core._ import MegaPhase.MiniPhase import dotty.tools.dotc.core.Contexts._ import ast._ -import Trees._ import Flags._ import Symbols._ import Contexts._ @@ -14,7 +13,6 @@ import DenotTransformers._ import ExplicitOuter.isOuterParamAccessor import CountOuterAccesses.mightBeDropped import collection.mutable -import annotation.threadUnsafe object DropOuterAccessors: val name: String = "dropOuterAccessors" diff --git a/compiler/src/dotty/tools/dotc/transform/ElimOpaque.scala b/compiler/src/dotty/tools/dotc/transform/ElimOpaque.scala index a6f9cbf7dbe9..2f55826ec2a3 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimOpaque.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimOpaque.scala @@ -8,13 +8,10 @@ import Flags._ import Types._ import Contexts._ import Symbols._ -import Decorators._ import Denotations.{SingleDenotation, NonSymSingleDenotation} import SymDenotations.SymDenotation import DenotTransformers._ -import TypeUtils._ import Names._ -import ast.Trees._ object ElimOpaque { val name: String = "elimOpaque" diff --git a/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala b/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala index 1ca258420aa2..b91da4e9de88 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala @@ -6,14 +6,11 @@ import core._ import StdNames.nme import Types._ import transform.MegaPhase._ -import ast.Trees._ import Flags._ import Contexts._ import Symbols._ -import Constants._ import Decorators._ import Denotations._, SymDenotations._ -import TypeErasure.erasure import DenotTransformers._ import NullOpsDecorator._ diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index d16cc2f66f51..739f7d6b06b4 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -18,7 +18,7 @@ import core.Decorators._ import core.Constants._ import core.Definitions._ import core.Annotations.BodyAnnotation -import typer.{NoChecking, LiftErased} +import typer.NoChecking import typer.Inliner import typer.ProtoTypes._ import typer.ErrorReporting.errorTree @@ -26,7 +26,6 @@ import typer.Checking.checkValue import core.TypeErasure._ import core.Decorators._ import dotty.tools.dotc.ast.{tpd, untpd} -import ast.Trees._ import ast.TreeTypeMap import dotty.tools.dotc.core.{Constants, Flags} import ValueClasses._ @@ -36,7 +35,6 @@ import ExplicitOuter._ import core.Mode import util.Property import reporting._ -import collection.mutable class Erasure extends Phase with DenotTransformer { diff --git a/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala b/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala index ab5190daf0e8..b2aab80e98b4 100644 --- a/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala +++ b/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala @@ -6,7 +6,6 @@ import MegaPhase.MiniPhase import core.* import Symbols.*, Contexts.*, Types.*, Decorators.* import StdNames.nme -import ast.Trees.* /** Rewrite `(x1, ... xN) => f(x1, ... xN)` for N >= 0 to `f`, * provided `f` is a pure path of function type. diff --git a/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala b/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala index f02f6b61d588..41e5b76ca874 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala @@ -9,7 +9,6 @@ import Flags._ import SymDenotations._ import Decorators._ -import ast.Trees._ import MegaPhase._ import java.io.File.separatorChar diff --git a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala index 250da980cfd0..6f2aa7d970ac 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala @@ -8,10 +8,7 @@ import Contexts._, Symbols._, Types._, Flags._, Decorators._, StdNames._, Consta import MegaPhase._ import SymUtils._ import NullOpsDecorator._ -import ast.Trees._ import ast.untpd -import reporting._ -import dotty.tools.dotc.util.Spans.Span /** Expand SAM closures that cannot be represented by the JVM as lambdas to anonymous classes. * These fall into five categories diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala index 1ae915a1fc10..a7f8421f51d0 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -13,7 +13,6 @@ import core.Decorators._ import core.StdNames.nme import core.Names._ import core.NameOps._ -import ast.Trees._ import SymUtils._ import dotty.tools.dotc.ast.tpd diff --git a/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala b/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala index 27aee2d445d9..9c580235a2e4 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala @@ -13,7 +13,7 @@ import core._ import Types._, Contexts._, Names._, Flags._, DenotTransformers._, Phases._ import SymDenotations._, Symbols._, StdNames._, Denotations._ import TypeErasure.{ valueErasure, ErasedValueType } -import NameKinds.{ExtMethName, UniqueExtMethName} +import NameKinds.ExtMethName import Decorators._ import TypeUtils._ diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala index b01fc0a992df..a3459e890487 100644 --- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala +++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala @@ -4,7 +4,6 @@ package transform import core._ import Names._ import dotty.tools.dotc.transform.MegaPhase._ -import ast.Trees._ import ast.untpd import Flags._ import Types._ @@ -17,7 +16,6 @@ import DenotTransformers._ import NameOps._ import NameKinds.OuterSelectName import StdNames._ -import NullOpsDecorator._ import TypeUtils.isErasedValueType object FirstTransform { diff --git a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala index 93f72199617e..3869818fb129 100644 --- a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala +++ b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala @@ -8,9 +8,7 @@ import Symbols._ import Decorators._ import TypeUtils._ import StdNames.nme -import NameOps._ import ast._ -import ast.Trees._ /** Provides methods to produce fully parameterized versions of instance methods, * where the `this` of the enclosing class is abstracted out in an extra leading diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index c18009784ba9..fae5f79d51b2 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -7,18 +7,16 @@ import core.Contexts._ import core.Phases._ import core.Definitions import core.Flags._ -import core.Names.{DerivedName, Name, SimpleName, TypeName} +import core.Names.Name import core.Symbols._ import core.TypeApplications.TypeParamInfo import core.TypeErasure.{erasedGlb, erasure, isGenericArrayElement} import core.Types._ import core.classfile.ClassfileConstants -import ast.Trees._ import SymUtils._ import TypeUtils._ import java.lang.StringBuilder -import scala.annotation.tailrec import scala.collection.mutable.ListBuffer /** Helper object to generate generic java signatures, as defined in diff --git a/compiler/src/dotty/tools/dotc/transform/Getters.scala b/compiler/src/dotty/tools/dotc/transform/Getters.scala index 2a46185a0512..ad06bfb0a504 100644 --- a/compiler/src/dotty/tools/dotc/transform/Getters.scala +++ b/compiler/src/dotty/tools/dotc/transform/Getters.scala @@ -12,7 +12,6 @@ import Flags._ import ValueClasses._ import SymUtils._ import NameOps._ -import collection.mutable /** Performs the following rewritings for fields of a class: diff --git a/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala b/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala index 80f7402dfc53..6edb60a77245 100644 --- a/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala +++ b/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala @@ -5,11 +5,8 @@ package transform import core._ import MegaPhase._ import Symbols._, Contexts._, Types._, Decorators._ -import StdNames.nme import NameOps._ import Names._ -import ast.Trees._ -import ast.TreeTypeMap /** Rewrite an application * diff --git a/compiler/src/dotty/tools/dotc/transform/Inlining.scala b/compiler/src/dotty/tools/dotc/transform/Inlining.scala index 32805ed0d596..f9aefdd95bfc 100644 --- a/compiler/src/dotty/tools/dotc/transform/Inlining.scala +++ b/compiler/src/dotty/tools/dotc/transform/Inlining.scala @@ -2,38 +2,20 @@ package dotty.tools.dotc package transform import core._ -import Decorators._ import Flags._ -import Types._ import Contexts._ import Symbols._ -import Constants._ -import ast.Trees._ -import ast.{TreeTypeMap, untpd} -import util.Spans._ import SymUtils._ -import NameKinds._ import dotty.tools.dotc.ast.tpd -import typer.Implicits.SearchFailureType -import typer.PrepareInlineable -import scala.collection.mutable -import dotty.tools.dotc.core.Annotations._ -import dotty.tools.dotc.core.Names._ -import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.StagingContext._ -import dotty.tools.dotc.quoted._ -import dotty.tools.dotc.transform.TreeMapWithStages._ import dotty.tools.dotc.typer.Inliner -import dotty.tools.dotc.typer.ImportInfo.withRootImports import dotty.tools.dotc.ast.TreeMapWithImplicits -import scala.annotation.constructorOnly /** Inlines all calls to inline methods that are not in an inline method or a quote */ class Inlining extends MacroTransform { import tpd._ - import Inlining._ override def phaseName: String = Inlining.name diff --git a/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala b/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala index 12d845ca9a68..046147f20d82 100644 --- a/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala +++ b/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala @@ -6,12 +6,9 @@ import core._ import Contexts._ import Symbols._ import Flags._ -import SymDenotations._ import Decorators._ -import ast.Trees._ import MegaPhase._ -import StdNames.nme import Names._ import Constants.Constant diff --git a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala index a2ec4da70c1c..a97d8884625a 100644 --- a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala @@ -1,7 +1,6 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.core.Contexts._ diff --git a/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala b/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala index ce392c636a76..464e0d59afed 100644 --- a/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -13,7 +13,6 @@ import core.StdNames.nme import core.Names._ import core.NameOps._ import core.NameKinds.ExpandPrefixName -import ast.Trees._ import SymUtils._ import ExplicitOuter.outer import util.Store diff --git a/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala b/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala index c7ad2381c5f7..e7ff6d10c222 100644 --- a/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala +++ b/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala @@ -5,7 +5,6 @@ package transform import core._ import Contexts._, Symbols._, Decorators._ import MegaPhase._ -import ast.Trees._ /** Rewrite `{ stats; expr}.f(args)` to `{ stats; expr.f(args) }` and * `{ stats; expr }(args)` to `{ stats; expr(args) }` before proceeding, diff --git a/compiler/src/dotty/tools/dotc/transform/MacroTransform.scala b/compiler/src/dotty/tools/dotc/transform/MacroTransform.scala index 0baf85c4e21d..27ccd622bc65 100644 --- a/compiler/src/dotty/tools/dotc/transform/MacroTransform.scala +++ b/compiler/src/dotty/tools/dotc/transform/MacroTransform.scala @@ -5,9 +5,6 @@ import core._ import Phases._ import ast.Trees._ import Contexts._ -import Symbols._ -import Flags.PackageVal -import Decorators._ /** A base class for transforms. * A transform contains a compiler phase which applies a tree transformer. diff --git a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala index 56342322824c..29e30657e7a5 100644 --- a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala +++ b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala @@ -3,7 +3,6 @@ package dotc package transform import core._ -import ast.Trees._ import Contexts._, Phases._, Symbols._, Decorators._ import Flags.PackageVal diff --git a/compiler/src/dotty/tools/dotc/transform/Memoize.scala b/compiler/src/dotty/tools/dotc/transform/Memoize.scala index 8e9bea8384c2..0bbe0dc775a0 100644 --- a/compiler/src/dotty/tools/dotc/transform/Memoize.scala +++ b/compiler/src/dotty/tools/dotc/transform/Memoize.scala @@ -10,9 +10,7 @@ import Denotations._ import Symbols._ import SymUtils._ import Constants._ -import ast.Trees._ import MegaPhase._ -import NameKinds.TraitSetterName import NameOps._ import Flags._ import Decorators._ diff --git a/compiler/src/dotty/tools/dotc/transform/Mixin.scala b/compiler/src/dotty/tools/dotc/transform/Mixin.scala index c3828327385c..b5881d88f5f1 100644 --- a/compiler/src/dotty/tools/dotc/transform/Mixin.scala +++ b/compiler/src/dotty/tools/dotc/transform/Mixin.scala @@ -10,7 +10,6 @@ import SymUtils._ import Symbols._ import SymDenotations._ import Types._ -import Periods._ import Decorators._ import DenotTransformers._ import StdNames._ @@ -18,7 +17,6 @@ import Names._ import NameKinds._ import NameOps._ import ast.Trees._ -import collection.mutable object Mixin { val name: String = "mixin" diff --git a/compiler/src/dotty/tools/dotc/transform/MixinOps.scala b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala index 1b25061a4020..787a0d5be1df 100644 --- a/compiler/src/dotty/tools/dotc/transform/MixinOps.scala +++ b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala @@ -6,7 +6,6 @@ import Symbols._, Types._, Contexts._, DenotTransformers._, Flags._ import util.Spans._ import SymUtils._ import StdNames._, NameOps._ -import Decorators._ class MixinOps(cls: ClassSymbol, thisPhase: DenotTransformer)(using Context) { import ast.tpd._ diff --git a/compiler/src/dotty/tools/dotc/transform/MoveStatics.scala b/compiler/src/dotty/tools/dotc/transform/MoveStatics.scala index bf25bfe71569..99702686edf8 100644 --- a/compiler/src/dotty/tools/dotc/transform/MoveStatics.scala +++ b/compiler/src/dotty/tools/dotc/transform/MoveStatics.scala @@ -5,7 +5,6 @@ import core._ import Flags._ import Contexts._ import Symbols._ -import Decorators._ import DenotTransformers.SymTransformer import Types.MethodType import Annotations.Annotation @@ -14,7 +13,6 @@ import Names.Name import StdNames.nme import NameOps._ -import reporting._ import ast._ import SymUtils._ diff --git a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala index 4ab9663f6529..67e3294d2135 100644 --- a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala +++ b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala @@ -5,7 +5,6 @@ import core._ import Contexts._, Symbols._, Types._, Flags._, StdNames._ import MegaPhase._ import NameKinds.NonLocalReturnKeyName -import config.Feature.sourceVersion import config.SourceVersion._ object NonLocalReturns { diff --git a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala index 7a0516c38991..d733359a5dcd 100644 --- a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala +++ b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala @@ -6,7 +6,6 @@ import core._ import Flags._, Symbols._, Contexts._, Scopes._, Decorators._, Types.Type import NameKinds.DefaultGetterName import NullOpsDecorator._ -import collection.mutable import collection.immutable.BitSet import scala.annotation.tailrec diff --git a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala index 47e5ae96f5da..012cec761aff 100644 --- a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala +++ b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala @@ -1,10 +1,8 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.ast.Trees._ -import dotty.tools.dotc.ast.{TreeTypeMap, tpd, untpd} +import dotty.tools.dotc.ast.{tpd, untpd} import dotty.tools.dotc.core.Annotations.BodyAnnotation -import dotty.tools.dotc.core.Constants._ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags._ @@ -13,17 +11,13 @@ import dotty.tools.dotc.core.StagingContext._ import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Types._ -import dotty.tools.dotc.quoted._ import dotty.tools.dotc.util.SrcPos import dotty.tools.dotc.util.Spans._ import dotty.tools.dotc.transform.SymUtils._ -import dotty.tools.dotc.transform.TreeMapWithStages._ import dotty.tools.dotc.typer.Checking import dotty.tools.dotc.typer.Implicits.SearchFailureType -import dotty.tools.dotc.typer.Inliner import dotty.tools.dotc.core.Annotations._ -import scala.collection.mutable import dotty.tools.dotc.util.Property import scala.annotation.constructorOnly diff --git a/compiler/src/dotty/tools/dotc/transform/ParamForwarding.scala b/compiler/src/dotty/tools/dotc/transform/ParamForwarding.scala index 6eb29f26edea..5d147755f22b 100644 --- a/compiler/src/dotty/tools/dotc/transform/ParamForwarding.scala +++ b/compiler/src/dotty/tools/dotc/transform/ParamForwarding.scala @@ -3,12 +3,10 @@ package dotc package transform import core._ -import ast.Trees._ import Contexts._, Types._, Symbols._, Flags._, TypeUtils._, DenotTransformers._, StdNames._ import Decorators._ import MegaPhase._ import NameKinds.ParamAccessorName -import config.Printers.typr /** For all private parameter accessors * diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala index 21aa331367ca..79ea4d4c2121 100644 --- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -6,7 +6,6 @@ import core._ import MegaPhase._ import collection.mutable import Symbols._, Contexts._, Types._, StdNames._, NameOps._ -import ast.Trees._ import util.Spans._ import typer.Applications.* import SymUtils._ diff --git a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala index 96506d3c2b05..78640ed6163a 100644 --- a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala @@ -9,16 +9,13 @@ import Contexts._ import Symbols._ import Constants._ import ast.Trees._ -import ast.{TreeTypeMap, untpd} -import util.Spans._ +import ast.TreeTypeMap import SymUtils._ import NameKinds._ import dotty.tools.dotc.ast.tpd -import typer.Implicits.SearchFailureType import scala.collection.mutable import dotty.tools.dotc.core.Annotations._ -import dotty.tools.dotc.core.Names._ import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.quoted._ import dotty.tools.dotc.transform.TreeMapWithStages._ diff --git a/compiler/src/dotty/tools/dotc/transform/PostInlining.scala b/compiler/src/dotty/tools/dotc/transform/PostInlining.scala index e50a8b77ff0e..47b670c5598b 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostInlining.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostInlining.scala @@ -4,7 +4,6 @@ package transform import core._ import Contexts.* import DenotTransformers.IdentityDenotTransformer -import Decorators.* import SyntheticMembers.* import ast.tpd.* diff --git a/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala b/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala index fca0b6b34928..0ab852398049 100644 --- a/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala +++ b/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala @@ -7,10 +7,8 @@ import DenotTransformers.SymTransformer import Flags._ import SymDenotations._ import Symbols._ -import Types._ import typer.RefChecks import MegaPhase.MiniPhase -import StdNames.nme import ast.tpd import SymUtils._ import config.Feature diff --git a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala index 3c03fa012464..da439b0f4f84 100644 --- a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala +++ b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala @@ -10,7 +10,6 @@ import Symbols._ import Decorators._ import DenotTransformers._ import Names._ -import StdNames._ import NameOps._ import NameKinds._ import NullOpsDecorator._ diff --git a/compiler/src/dotty/tools/dotc/transform/RestoreScopes.scala b/compiler/src/dotty/tools/dotc/transform/RestoreScopes.scala index 4937b3ec80b1..d01be0419a4d 100644 --- a/compiler/src/dotty/tools/dotc/transform/RestoreScopes.scala +++ b/compiler/src/dotty/tools/dotc/transform/RestoreScopes.scala @@ -7,8 +7,6 @@ import Contexts._ import Symbols._ import Scopes._ import MegaPhase.MiniPhase -import ast.Trees._ -import StdNames._ /** The preceding lambda lift and flatten phases move symbols to different scopes * and rename them. This miniphase cleans up afterwards and makes sure that all diff --git a/compiler/src/dotty/tools/dotc/transform/SelectStatic.scala b/compiler/src/dotty/tools/dotc/transform/SelectStatic.scala index 1db210634ab6..1df9809c2f62 100644 --- a/compiler/src/dotty/tools/dotc/transform/SelectStatic.scala +++ b/compiler/src/dotty/tools/dotc/transform/SelectStatic.scala @@ -1,7 +1,6 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.DenotTransformers.IdentityDenotTransformer diff --git a/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala b/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala index a2bd55a1035d..d17dbbecc555 100644 --- a/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala +++ b/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc.transform -import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Phases.Phase diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala index 97e8e37ae444..84145742ed90 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala @@ -6,7 +6,6 @@ import Contexts._, Types._, Decorators._, Symbols._, DenotTransformers._ import SymDenotations._, Scopes._, StdNames._, NameOps._, Names._ import MegaPhase.MiniPhase -import scala.collection.mutable /** Specializes classes that inherit from `FunctionN` where there exists a * specialized form. diff --git a/compiler/src/dotty/tools/dotc/transform/Splicer.scala b/compiler/src/dotty/tools/dotc/transform/Splicer.scala index dcd5b8d8c4b5..8c34d5f3186d 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicer.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicer.scala @@ -5,17 +5,16 @@ import java.io.{PrintWriter, StringWriter} import java.lang.reflect.{InvocationTargetException, Method => JLRMethod} import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.NameKinds.FlatName -import dotty.tools.dotc.core.Names.{Name, TermName} +import dotty.tools.dotc.core.Names.Name import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Types._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Denotations.staticRef -import dotty.tools.dotc.core.{NameKinds, TypeErasure} +import dotty.tools.dotc.core.TypeErasure import dotty.tools.dotc.core.Constants.Constant import scala.util.control.NonFatal diff --git a/compiler/src/dotty/tools/dotc/transform/Staging.scala b/compiler/src/dotty/tools/dotc/transform/Staging.scala index dbfeaf4728b1..a327cff83950 100644 --- a/compiler/src/dotty/tools/dotc/transform/Staging.scala +++ b/compiler/src/dotty/tools/dotc/transform/Staging.scala @@ -1,28 +1,19 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.ast.Trees._ -import dotty.tools.dotc.ast.{TreeTypeMap, tpd, untpd} -import dotty.tools.dotc.core.Constants._ +import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Phases._ import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags._ -import dotty.tools.dotc.core.NameKinds._ import dotty.tools.dotc.core.StagingContext._ -import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Types._ -import dotty.tools.dotc.quoted._ -import dotty.tools.dotc.util.{SourceFile, SrcPos} +import dotty.tools.dotc.util.SrcPos import dotty.tools.dotc.transform.SymUtils._ import dotty.tools.dotc.transform.TreeMapWithStages._ -import dotty.tools.dotc.typer.Implicits.SearchFailureType -import dotty.tools.dotc.typer.Inliner -import scala.collection.mutable -import scala.annotation.constructorOnly /** Checks that the Phase Consistency Principle (PCP) holds and heals types. * @@ -30,7 +21,6 @@ import scala.annotation.constructorOnly */ class Staging extends MacroTransform { import tpd._ - import Staging._ override def phaseName: String = Staging.name diff --git a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala index aea1c49972ca..8d099d30f880 100644 --- a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala +++ b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala @@ -8,8 +8,6 @@ import ValueClasses.isMethodWithExtension import core._ import Contexts._, Flags._, Symbols._, Names._, StdNames._, NameOps._, Trees._ import TypeUtils._, SymUtils._ -import Constants.Constant -import Annotations.Annotation import DenotTransformers.DenotTransformer import Symbols._ import util.Spans._ diff --git a/compiler/src/dotty/tools/dotc/transform/SymUtils.scala b/compiler/src/dotty/tools/dotc/transform/SymUtils.scala index 93268b71a477..891c3076d093 100644 --- a/compiler/src/dotty/tools/dotc/transform/SymUtils.scala +++ b/compiler/src/dotty/tools/dotc/transform/SymUtils.scala @@ -11,7 +11,6 @@ import NameOps._ import StdNames._ import NameKinds._ import Flags._ -import Annotations._ import ValueClasses.isDerivedValueClass import Decorators._ import Constants.Constant @@ -19,7 +18,6 @@ import Annotations.Annotation import Phases._ import ast.tpd.Literal -import language.implicitConversions import scala.annotation.tailrec object SymUtils: diff --git a/compiler/src/dotty/tools/dotc/transform/TailRec.scala b/compiler/src/dotty/tools/dotc/transform/TailRec.scala index 66dcd4a9dfbd..bde4fbfbdaca 100644 --- a/compiler/src/dotty/tools/dotc/transform/TailRec.scala +++ b/compiler/src/dotty/tools/dotc/transform/TailRec.scala @@ -1,12 +1,10 @@ package dotty.tools.dotc package transform -import ast.Trees._ import ast.{TreeTypeMap, tpd} import config.Printers.tailrec import core.Contexts._ import core.Constants.Constant -import core.Decorators._ import core.Flags._ import core.NameKinds.{TailLabelName, TailLocalName, TailTempName} import core.StdNames.nme @@ -15,7 +13,6 @@ import reporting._ import transform.MegaPhase.MiniPhase import util.LinearSet -import scala.collection.mutable /** A Tail Rec Transformer. * diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index 29fd1adb6688..841c0fc15cc4 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -14,7 +14,6 @@ import core.Decorators._ import core.Phases._ import core.Mode import typer._ -import typer.ErrorReporting._ import reporting._ import ast.Trees._ import ast.{tpd, untpd} diff --git a/compiler/src/dotty/tools/dotc/transform/TreeMapWithStages.scala b/compiler/src/dotty/tools/dotc/transform/TreeMapWithStages.scala index c4a3ead114b0..9f142027864f 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeMapWithStages.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeMapWithStages.scala @@ -1,23 +1,13 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.ast.Trees._ -import dotty.tools.dotc.ast.{TreeMapWithImplicits, TreeTypeMap, tpd, untpd} +import dotty.tools.dotc.ast.{TreeMapWithImplicits, tpd} import dotty.tools.dotc.config.Printers.staging -import dotty.tools.dotc.core.Constants._ import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.core.Flags._ -import dotty.tools.dotc.core.NameKinds._ -import dotty.tools.dotc.core.Types._ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.StagingContext._ -import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.quoted._ -import dotty.tools.dotc.util.Spans._ import dotty.tools.dotc.util.Property -import dotty.tools.dotc.transform.SymUtils._ -import dotty.tools.dotc.typer.Implicits.SearchFailureType import scala.collection.mutable import scala.annotation.constructorOnly @@ -158,7 +148,6 @@ abstract class TreeMapWithStages(@constructorOnly ictx: Context) extends TreeMap object TreeMapWithStages { - import tpd._ /** A key to be used in a context property that caches the `levelOf` mapping */ private val LevelOfKey = new Property.Key[mutable.HashMap[Symbol, Int]] diff --git a/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala b/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala index 34971911bc7d..91f63a033c76 100644 --- a/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala +++ b/compiler/src/dotty/tools/dotc/transform/TryCatchPatterns.scala @@ -3,7 +3,6 @@ package transform import core.Symbols._ import core.StdNames._ -import ast.Trees._ import core.Types._ import core.NameKinds.ExceptionBinderName import dotty.tools.dotc.core.Flags diff --git a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala index d7705111444f..6370bb51afb9 100644 --- a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala +++ b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala @@ -2,11 +2,8 @@ package dotty.tools.dotc package transform import core._ -import Constants.Constant import Contexts._ import Decorators._ -import Flags._ -import ast.Trees._ import Definitions._ import DenotTransformers._ import StdNames._ @@ -15,7 +12,6 @@ import MegaPhase._ import Types._ import dotty.tools.dotc.ast.tpd -import scala.annotation.tailrec /** Optimize generic operations on tuples */ class TupleOptimizations extends MiniPhase with IdentityDenotTransformer { diff --git a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index 8ffe2198c4d9..c467e2dbd8f3 100644 --- a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -4,7 +4,6 @@ package transform import core._ import Contexts._, Symbols._, Types._, Constants._, StdNames._, Decorators._ -import ast.Trees._ import ast.untpd import Erasure.Boxing._ import TypeErasure._ diff --git a/compiler/src/dotty/tools/dotc/transform/UncacheGivenAliases.scala b/compiler/src/dotty/tools/dotc/transform/UncacheGivenAliases.scala index 29f9e68aa7fa..56fd4f754d60 100644 --- a/compiler/src/dotty/tools/dotc/transform/UncacheGivenAliases.scala +++ b/compiler/src/dotty/tools/dotc/transform/UncacheGivenAliases.scala @@ -7,10 +7,6 @@ import core.Symbols._ import core.Contexts._ import core.Types._ import core.Flags._ -import core.StdNames.nme -import core.Constants.Constant -import core.Decorators._ -import core.TypeErasure.erasure import ast.tpd object UncacheGivenAliases: diff --git a/compiler/src/dotty/tools/dotc/transform/UninitializedDefs.scala b/compiler/src/dotty/tools/dotc/transform/UninitializedDefs.scala index d63e2d453b44..9f796cc1abe7 100644 --- a/compiler/src/dotty/tools/dotc/transform/UninitializedDefs.scala +++ b/compiler/src/dotty/tools/dotc/transform/UninitializedDefs.scala @@ -3,12 +3,8 @@ package transform import core._ import Contexts._ -import DenotTransformers.SymTransformer import Flags._ -import SymDenotations._ import Symbols._ -import Types._ -import typer.RefChecks import MegaPhase.MiniPhase import StdNames.nme import ast.tpd diff --git a/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala b/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala index fb0731198a98..b3634e7cc07a 100644 --- a/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala +++ b/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala @@ -1,7 +1,6 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.{tpd, untpd} import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ diff --git a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala index 9d95951cb36c..e77abbb99549 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala @@ -16,7 +16,6 @@ import StdNames._ import dotty.tools.dotc.transform._ import Phases._ -import scala.collection.mutable import Semantic._ diff --git a/compiler/src/dotty/tools/dotc/transform/init/Semantic.scala b/compiler/src/dotty/tools/dotc/transform/init/Semantic.scala index c1e7d6ab9f2a..33fd9a5f2f1d 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Semantic.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Semantic.scala @@ -18,7 +18,6 @@ import Errors._ import scala.collection.mutable import scala.annotation.tailrec -import scala.annotation.constructorOnly object Semantic { diff --git a/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala b/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala index 0ba7bd14a9b6..bc5219a33883 100644 --- a/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala @@ -6,7 +6,6 @@ import scala.collection.mutable.ListBuffer import scala.util.chaining.* import scala.util.matching.Regex.Match -import java.util.{Calendar, Date, Formattable} import PartialFunction.cond diff --git a/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala index b8e6300f4e04..79c09fdf6606 100644 --- a/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala +++ b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala @@ -1,13 +1,11 @@ package dotty.tools.dotc package transform.localopt -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.StdNames._ -import dotty.tools.dotc.core.NameKinds._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Types._ import dotty.tools.dotc.transform.MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index 7fbd6ba22178..ce1a5d9a10c2 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -7,7 +7,6 @@ import Types._ import Contexts._ import Flags._ import ast._ -import Trees._ import Decorators._ import Symbols._ import StdNames._ @@ -21,7 +20,6 @@ import transform.SymUtils._ import reporting._ import config.Printers.{exhaustivity => debug} import util.{SrcPos, NoSourcePosition} -import NullOpsDecorator._ import collection.mutable /** Space logic for checking exhaustivity and unreachability of pattern matching @@ -321,7 +319,6 @@ object SpaceEngine { /** Scala implementation of space logic */ class SpaceEngine(using Context) extends SpaceLogic { import tpd._ - import SpaceEngine._ private val scalaSeqFactoryClass = defn.SeqFactoryClass private val scalaListType = defn.ListClass.typeRef diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala b/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala index da4c57afb3e6..9c575c9a9c3c 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala @@ -8,11 +8,7 @@ import core.Constants import core.Contexts._ import core.Decorators._ import core.StdNames.nme -import core.Phases._ import core.Symbols._ -import core.Types._ -import ast.Trees._ -import dotty.tools.dotc.ast.tpd import dotty.tools.backend.sjs.JSDefinitions.jsdefn diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala b/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala index c2685ee3c431..9353f6d82a8b 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala @@ -3,7 +3,6 @@ package dotc package transform package sjs -import scala.collection.mutable import MegaPhase._ import core.Annotations._ @@ -12,7 +11,6 @@ import core.Denotations._ import core.DenotTransformers._ import core.Symbols._ import core.Contexts._ -import core.Phases._ import core.Types._ import core.Flags._ import core.Decorators._ @@ -20,10 +18,7 @@ import core.StdNames.nme import core.SymDenotations.SymDenotation import core.Names._ import core.NameKinds._ -import core.NameOps._ -import ast.Trees._ import SymUtils._ -import dotty.tools.dotc.ast.tpd import util.Store diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/JSExportUtils.scala b/compiler/src/dotty/tools/dotc/transform/sjs/JSExportUtils.scala index 57e5fc636ddc..90e5d2dffbed 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/JSExportUtils.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/JSExportUtils.scala @@ -3,26 +3,9 @@ package transform package sjs import core._ -import util.SrcPos -import Annotations._ -import Constants._ -import Contexts._ -import Decorators._ -import DenotTransformers._ -import Flags._ import NameKinds.DefaultGetterName -import NameOps._ import Names._ -import Phases._ -import Scopes._ -import StdNames._ -import Symbols._ -import SymDenotations._ -import SymUtils._ -import ast.Trees._ -import Types._ -import dotty.tools.backend.sjs.JSDefinitions.jsdefn /** Utilities for JS exports handling. */ object JSExportUtils { diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/JSSymUtils.scala b/compiler/src/dotty/tools/dotc/transform/sjs/JSSymUtils.scala index a78adaff6522..30eed76b18ec 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/JSSymUtils.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/JSSymUtils.scala @@ -3,21 +3,14 @@ package transform package sjs import core._ -import util.SrcPos -import Annotations._ import Constants._ import Contexts._ -import Decorators._ -import DenotTransformers._ import Flags._ -import NameKinds.DefaultGetterName import NameOps._ import Names._ import Phases._ -import Scopes._ import StdNames._ import Symbols._ -import SymDenotations._ import SymUtils._ import ast.Trees._ import Types._ diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala b/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala index c6f1feba5e98..817a6c5afabc 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala @@ -7,11 +7,8 @@ import scala.annotation.tailrec import dotty.tools.dotc.core._ import Constants._ import Contexts._ -import Decorators._ import Flags._ import Names._ -import NameOps._ -import Phases._ import Scopes._ import Symbols._ import StdNames._ diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala index 9efe57a5c982..b0de197635e9 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala @@ -2,27 +2,18 @@ package dotty.tools.dotc package transform package sjs -import dotty.tools.dotc.ast.{Trees, tpd, untpd} +import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core._ -import Annotations._ import Contexts._ import Decorators._ import Denotations._ -import DenotTransformers._ import Flags._ -import Names._ import NameKinds.DefaultGetterName -import NameOps._ -import Phases._ -import Scopes._ import StdNames._ import Symbols._ -import SymDenotations._ import SymUtils._ -import Trees._ import Types._ -import reporting._ import util.Spans.Span import util.SrcPos diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala index c9cf71554bc6..e97585735eb7 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala @@ -4,9 +4,8 @@ package sjs import scala.collection.mutable -import ast.{Trees, tpd, untpd} +import ast.tpd import core._ -import reporting._ import typer.Checking import util.SrcPos import Annotations._ @@ -16,22 +15,15 @@ import Decorators._ import DenotTransformers._ import Flags._ import NameKinds.DefaultGetterName -import NameOps._ -import Names._ -import Phases._ -import Scopes._ import StdNames._ import Symbols._ -import SymDenotations._ import SymUtils._ -import Trees._ import Types._ import JSSymUtils._ -import org.scalajs.ir.Trees.{JSGlobalRef, JSNativeLoadSpec} +import org.scalajs.ir.Trees.JSGlobalRef -import dotty.tools.dotc.config.SJSPlatform.sjsPlatform import dotty.tools.backend.sjs.JSDefinitions.jsdefn /** A macro transform that runs after typer and before pickler to perform @@ -508,7 +500,6 @@ class PrepJSInterop extends MacroTransform with IdentityDenotTransformer { thisP } private def checkJSNativeLoadSpecOf(pos: SrcPos, sym: Symbol)(using Context): Unit = { - import JSNativeLoadSpec._ def checkGlobalRefName(globalRef: String): Unit = { if (!JSGlobalRef.isValidJSGlobalRefName(globalRef)) @@ -998,7 +989,6 @@ object PrepJSInterop { val description: String = "additional checks and transformations for Scala.js" private final class OwnerKind private (private val baseKinds: Int) extends AnyVal { - import OwnerKind._ inline def isBaseKind: Boolean = Integer.lowestOneBit(baseKinds) == baseKinds && baseKinds != 0 // exactly 1 bit on diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 1e324de33675..0681c8ee2481 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -4,12 +4,10 @@ package typer import core._ import ast.{Trees, tpd, untpd, desugar} -import util.Spans._ import util.Stats.record -import util.{SrcPos, NoSourcePosition, SourceFile} +import util.{SrcPos, NoSourcePosition} import Trees.Untyped import Contexts._ -import Phases._ import Flags._ import Symbols._ import Denotations.Denotation @@ -19,7 +17,6 @@ import ErrorReporting._ import Trees._ import Names._ import StdNames._ -import NameOps._ import ContextOps._ import NameKinds.DefaultGetterName import ProtoTypes._ @@ -28,15 +25,15 @@ import reporting._ import transform.TypeUtils._ import transform.SymUtils._ import Nullables._ -import config.{Feature, Config} +import config.Feature import collection.mutable import config.Printers.{overload, typr, unapp} import TypeApplications._ -import Constants.{Constant, IntTag, LongTag} +import Constants.{Constant, IntTag} import Denotations.SingleDenotation -import annotation.{constructorOnly, threadUnsafe} +import annotation.threadUnsafe import scala.util.control.NonFatal diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index be38221ef167..5c1e1757de52 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -11,11 +11,9 @@ import Names._ import StdNames._ import Symbols._ import Trees._ -import TreeInfo._ import ProtoTypes._ import Scopes._ import CheckRealizable._ -import NullOpsDecorator._ import ErrorReporting.errorTree import rewrites.Rewrites.patch import util.Spans.Span @@ -43,7 +41,6 @@ import transform.TypeUtils.* import collection.mutable import reporting._ -import util.Chars.isOperatorPart object Checking { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/typer/ConstFold.scala b/compiler/src/dotty/tools/dotc/typer/ConstFold.scala index 3e09642d291d..1710d7ceff3c 100644 --- a/compiler/src/dotty/tools/dotc/typer/ConstFold.scala +++ b/compiler/src/dotty/tools/dotc/typer/ConstFold.scala @@ -4,7 +4,6 @@ package typer import java.lang.ArithmeticException import ast._ -import Trees._ import core._ import Symbols._ import Types._ diff --git a/compiler/src/dotty/tools/dotc/typer/Deriving.scala b/compiler/src/dotty/tools/dotc/typer/Deriving.scala index 39a775d61f8c..77137b46f707 100644 --- a/compiler/src/dotty/tools/dotc/typer/Deriving.scala +++ b/compiler/src/dotty/tools/dotc/typer/Deriving.scala @@ -11,11 +11,6 @@ import ProtoTypes._, ContextOps._ import util.Spans._ import util.SrcPos import collection.mutable -import Constants.Constant -import config.Printers.derive -import Inferencing._ -import transform.TypeUtils._ -import transform.SymUtils._ import ErrorReporting.errorTree /** A typer mixin that implements type class derivation functionality */ diff --git a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala index 72a0cfe9dcbe..23e575c0c2bf 100644 --- a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala +++ b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala @@ -14,7 +14,6 @@ import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.TypeErasure import util.Spans._ import core.Symbols._ -import core.Definitions import ErrorReporting._ import reporting._ diff --git a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala index 733977734329..b7a9a901f34c 100644 --- a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -8,7 +8,6 @@ import Types._, ProtoTypes._, Contexts._, Decorators._, Denotations._, Symbols._ import Implicits._, Flags._, Constants.Constant import Trees._ import NameOps._ -import util.Spans._ import util.SrcPos import config.Feature import java.util.regex.Matcher.quoteReplacement diff --git a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala index c04b5f1d2d85..c0c6ede200ed 100644 --- a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala +++ b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala @@ -9,12 +9,10 @@ import Types._ import Flags._ import Symbols._ import Names._ -import StdNames._ import NameKinds.UniqueName import util.Spans._ import collection.mutable import Trees._ -import Decorators._ /** A class that handles argument lifting. Argument lifting is needed in the following * scenarios: diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index 90e0eae4afe8..d61728e53819 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -4,7 +4,7 @@ package typer import backend.sjs.JSDefinitions import core._ -import ast.{Trees, TreeTypeMap, untpd, tpd, DesugarEnums} +import ast.{TreeTypeMap, untpd, tpd} import util.Spans._ import util.Stats.{record, monitored} import printing.{Showable, Printer} @@ -13,24 +13,19 @@ import Contexts._ import Types._ import Flags._ import Mode.ImplicitsEnabled -import NameOps._ import NameKinds.{LazyImplicitName, EvidenceParamName} import Symbols._ -import Denotations._ import Types._ import Decorators._ import Names._ import StdNames._ -import Constants._ import ProtoTypes._ import ErrorReporting._ import Inferencing.{fullyDefinedType, isFullyDefined} import Scopes.newScope -import Trees._ -import transform.SymUtils._ import transform.TypeUtils._ import Hashable._ -import util.{SourceFile, NoSource, EqHashMap, Stats} +import util.{EqHashMap, Stats} import config.{Config, Feature} import Feature.migrateTo3 import config.Printers.{implicits, implicitsDetailed} diff --git a/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala b/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala index e8a923427b38..264ff78c8c8f 100644 --- a/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala +++ b/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala @@ -3,17 +3,14 @@ package dotc package typer import ast.{tpd, untpd} -import ast.Trees._ import core._ import printing.{Printer, Showable} import util.SimpleIdentityMap import Symbols._, Names._, Types._, Contexts._, StdNames._, Flags._ import Implicits.RenamedImplicitRef -import config.SourceVersion import StdNames.nme import printing.Texts.Text import NameKinds.QualifiedName -import Decorators._ object ImportInfo { diff --git a/compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala b/compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala index bc82c9501c76..a1a33482877c 100644 --- a/compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala +++ b/compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala @@ -7,10 +7,8 @@ import core._ import Contexts._, Types._, Symbols._, Names._, Decorators._, ProtoTypes._ import Flags._, SymDenotations._ import NameKinds.FlatName -import NameOps._ import StdNames._ import config.Printers.{implicits, implicitsDetailed} -import util.Spans.Span import ast.{untpd, tpd} import Implicits.{hasExtMethod, Candidate} import java.util.{Timer, TimerTask} diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index 17df9c93f9a9..733b95995f05 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -5,19 +5,16 @@ package typer import core._ import ast._ import Contexts._, Types._, Flags._, Symbols._ -import Trees._ import ProtoTypes._ import NameKinds.{AvoidNameKind, UniqueName} import util.Spans._ import util.{Stats, SimpleIdentityMap} import Decorators._ -import config.Printers.{gadts, typr, debug} +import config.Printers.{gadts, typr} import annotation.tailrec -import reporting._ import collection.mutable import scala.annotation.internal.sharable -import scala.annotation.threadUnsafe import config.Printers.gadts diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index 7749f4f0c0b7..8052af5ff6e9 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -3,7 +3,6 @@ package dotc package typer import ast.{TreeInfo, tpd, _} -import Trees._ import core._ import Flags._ import Symbols._ @@ -17,14 +16,13 @@ import Contexts._ import Names.{Name, TermName} import NameKinds.{InlineAccessorName, InlineBinderName, InlineScrutineeName, BodyRetainerName} import ProtoTypes.shallowSelectionProto -import Annotations.Annotation import SymDenotations.SymDenotation import Inferencing.isFullyDefined import Scopes.newScope import config.Printers.inlining import config.Feature import ErrorReporting.errorTree -import dotty.tools.dotc.util.{SimpleIdentityMap, SimpleIdentitySet, EqHashMap, SourceFile, SourcePosition, SrcPos} +import dotty.tools.dotc.util.{SimpleIdentityMap, SimpleIdentitySet, SourceFile, SourcePosition, SrcPos} import dotty.tools.dotc.parsing.Parsers.Parser import Nullables._ import transform.{PostTyper, Inlining} @@ -32,7 +30,7 @@ import transform.{PostTyper, Inlining} import collection.mutable import reporting.trace import util.Spans.Span -import dotty.tools.dotc.transform.{Splicer, TreeMapWithStages} +import dotty.tools.dotc.transform.Splicer import quoted.QuoteUtils import scala.annotation.constructorOnly diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 4bca5c50cf77..ef3d844fb570 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -8,7 +8,6 @@ import Trees._, StdNames._, Scopes._, Denotations._, NamerOps._, ContextOps._ import Contexts._, Symbols._, Types._, SymDenotations._, Names._, NameOps._, Flags._ import Decorators._, Comments.{_, given} import NameKinds.DefaultGetterName -import TypeApplications.TypeParamInfo import ast.desugar, ast.desugar._ import ProtoTypes._ import util.Spans._ @@ -29,7 +28,6 @@ import reporting._ import config.Feature.sourceVersion import config.SourceVersion._ -import scala.annotation.constructorOnly /** This class creates symbols from definitions and imports and gives them * lazy types. diff --git a/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala b/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala index 8fea810921e4..48fc1c70ded0 100644 --- a/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala +++ b/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala @@ -10,17 +10,15 @@ import Symbols._ import Flags._ import Types._ import Decorators._ -import NameKinds._ import StdNames.nme import Contexts._ import Names.{Name, TermName} import NameKinds.{InlineAccessorName, UniqueInlineName} import NameOps._ import Annotations._ -import transform.{AccessProxies, PCPCheckAndHeal, Splicer, TreeMapWithStages} +import transform.{AccessProxies, PCPCheckAndHeal, Splicer} import config.Printers.inlining import util.Property -import dotty.tools.dotc.core.StagingContext._ import dotty.tools.dotc.transform.TreeMapWithStages._ object PrepareInlineable { diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index fcbcf179d97e..9bfc66a70be6 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -13,7 +13,6 @@ import Decorators._ import Uniques._ import config.Printers.typr import util.SourceFile -import util.Property import TypeComparer.necessarySubType import scala.annotation.internal.sharable diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 86cd7e5f24f3..f8422ed20e21 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -2,34 +2,27 @@ package dotty.tools.dotc package typer import dotty.tools.dotc.ast._ -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.config.Feature._ import dotty.tools.dotc.config.SourceVersion._ import dotty.tools.dotc.core._ import dotty.tools.dotc.core.Annotations._ -import dotty.tools.dotc.core.Constants._ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags._ -import dotty.tools.dotc.core.NameKinds.{UniqueName, PatMatGivenVarName} +import dotty.tools.dotc.core.NameKinds.PatMatGivenVarName import dotty.tools.dotc.core.Names._ import dotty.tools.dotc.core.StagingContext._ import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.core.Types._ -import dotty.tools.dotc.reporting._ import dotty.tools.dotc.transform.SymUtils._ import dotty.tools.dotc.typer.Implicits._ import dotty.tools.dotc.typer.Inferencing._ -import dotty.tools.dotc.typer.ProtoTypes._ import dotty.tools.dotc.util.Spans._ import dotty.tools.dotc.util.Stats.record import scala.collection.mutable -import scala.annotation.tailrec -import scala.annotation.internal.sharable -import scala.annotation.threadUnsafe /** Type quotes `'{ ... }` and splices `${ ... }` */ trait QuotesAndSplices { diff --git a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala index 85be8c32227a..0a2172ddf7bf 100644 --- a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala @@ -8,8 +8,7 @@ import Symbols._ import StdNames._ import Decorators._ import typer.ProtoTypes._ -import ast.{tpd, untpd, Trees} -import Trees._ +import ast.{tpd, untpd} import scala.util.control.NonFatal import util.Spans.Span import Nullables._ diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 834cfba2a8a0..8f2c77fc6574 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -7,10 +7,8 @@ import core._ import Symbols._, Types._, Contexts._, Flags._, Names._, NameOps._, NameKinds._ import StdNames._, Denotations._, SymUtils._, Phases._, SymDenotations._ import NameKinds.DefaultGetterName -import Annotations._ import util.Spans._ -import util.SrcPos -import scala.collection.{ mutable, immutable } +import scala.collection.mutable import ast._ import MegaPhase._ import config.Printers.{checks, noPrinter} @@ -20,9 +18,7 @@ import typer.ErrorReporting._ import config.Feature.{warnOnMigration, migrateTo3} import config.Printers.refcheck import reporting._ -import scala.util.matching.Regex._ import Constants.Constant -import NullOpsDecorator._ object RefChecks { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala index fe4feecd6100..b39fc4a01698 100644 --- a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala @@ -9,7 +9,7 @@ import Types._, Flags._, Symbols._, Types._, Names._, StdNames._, Constants._ import TypeErasure.{erasure, hasStableErasure} import Decorators._ import ProtoTypes._ -import Inferencing.{fullyDefinedType, isFullyDefined} +import Inferencing.fullyDefinedType import ast.untpd import transform.SymUtils._ import transform.TypeUtils._ diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index 3dcec413540f..2b5e7dd6f17c 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -6,15 +6,11 @@ import core._ import ast._ import Contexts._, ContextOps._, Constants._, Types._, Symbols._, Names._, Flags._, Decorators._ import ErrorReporting._, Annotations._, Denotations._, SymDenotations._, StdNames._ -import util.Spans._ import util.SrcPos -import config.Printers.typr -import ast.Trees._ import NameOps._ -import ProtoTypes._ import collection.mutable import reporting._ -import Checking.{checkNoPrivateLeaks, checkNoWildcard} +import Checking.checkNoPrivateLeaks trait TypeAssigner { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 09acde2ac845..e4e5dbcc85df 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -38,18 +38,16 @@ import collection.mutable import annotation.tailrec import Implicits._ import util.Stats.record -import config.Printers.{gadts, typr, debug} +import config.Printers.{gadts, typr} import config.Feature import config.Feature.{sourceVersion, migrateTo3} import config.SourceVersion._ import rewrites.Rewrites.patch -import NavigateAST._ import transform.SymUtils._ import transform.TypeUtils._ import reporting._ import Nullables._ import NullOpsDecorator._ -import config.Config import scala.annotation.constructorOnly diff --git a/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala b/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala index 070bf9fff12f..cf2a1c1d1379 100644 --- a/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala +++ b/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala @@ -6,17 +6,10 @@ import core._ import Phases._ import Contexts._ import Symbols._ -import Decorators._ import ImportInfo.withRootImports -import parsing.JavaParsers.JavaParser -import parsing.Parsers.Parser import parsing.{Parser => ParserPhase} -import config.Config -import config.Printers.{typr, default} +import config.Printers.typr import util.Stats._ -import util.{ SourcePosition, NoSourcePosition } -import scala.util.control.NonFatal -import ast.Trees._ /** * @@ -31,7 +24,6 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase { override def isTyper: Boolean = true - import ast.tpd override def allowsImplicitSearch: Boolean = true diff --git a/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala b/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala index 8c796cfb6fa9..88212c3bb96c 100644 --- a/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala +++ b/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala @@ -7,7 +7,6 @@ import Types._, Contexts._, Flags._, Symbols._, Trees._ import Decorators._ import Variances._ import NameKinds._ -import util.Spans._ import util.SrcPos import config.Printers.variances import config.Feature.migrateTo3 diff --git a/compiler/src/dotty/tools/dotc/util/EqHashMap.scala b/compiler/src/dotty/tools/dotc/util/EqHashMap.scala index df7b16d48927..39027e2d716d 100644 --- a/compiler/src/dotty/tools/dotc/util/EqHashMap.scala +++ b/compiler/src/dotty/tools/dotc/util/EqHashMap.scala @@ -6,7 +6,6 @@ package dotty.tools.dotc.util class EqHashMap[Key, Value] (initialCapacity: Int = 8, capacityMultiple: Int = 2) extends GenericHashMap[Key, Value](initialCapacity, capacityMultiple): - import GenericHashMap.DenseLimit /** Hashcode is identityHashCode left-shifted by 1, so lowest bit is not lost * when taking the index. diff --git a/compiler/src/dotty/tools/dotc/util/HashMap.scala b/compiler/src/dotty/tools/dotc/util/HashMap.scala index dd13d9c9a0e5..75d84301122f 100644 --- a/compiler/src/dotty/tools/dotc/util/HashMap.scala +++ b/compiler/src/dotty/tools/dotc/util/HashMap.scala @@ -6,7 +6,6 @@ package dotty.tools.dotc.util class HashMap[Key, Value] (initialCapacity: Int = 8, capacityMultiple: Int = 2) extends GenericHashMap[Key, Value](initialCapacity, capacityMultiple): - import GenericHashMap.DenseLimit /** Hashcode is left-shifted by 1, so lowest bit is not lost * when taking the index. diff --git a/compiler/src/dotty/tools/dotc/util/NameTransformer.scala b/compiler/src/dotty/tools/dotc/util/NameTransformer.scala index 5ea0d4bfe290..8b68836c068b 100644 --- a/compiler/src/dotty/tools/dotc/util/NameTransformer.scala +++ b/compiler/src/dotty/tools/dotc/util/NameTransformer.scala @@ -3,8 +3,6 @@ package dotc package util import core.Names._ -import collection.mutable -import util.Chars import scala.annotation.internal.sharable diff --git a/compiler/src/dotty/tools/dotc/util/ParsedComment.scala b/compiler/src/dotty/tools/dotc/util/ParsedComment.scala index e02aae1e8dbb..b7afe1aec2a4 100644 --- a/compiler/src/dotty/tools/dotc/util/ParsedComment.scala +++ b/compiler/src/dotty/tools/dotc/util/ParsedComment.scala @@ -6,9 +6,8 @@ import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.printing.SyntaxHighlighting -import scala.Console.{BOLD, RESET, UNDERLINED} +import scala.Console.{BOLD, RESET} import scala.collection.immutable.ListMap -import scala.util.matching.Regex /** * A parsed doc comment. diff --git a/compiler/src/dotty/tools/dotc/util/Signatures.scala b/compiler/src/dotty/tools/dotc/util/Signatures.scala index 414d4ce7bd8e..1d8c5d9b0c84 100644 --- a/compiler/src/dotty/tools/dotc/util/Signatures.scala +++ b/compiler/src/dotty/tools/dotc/util/Signatures.scala @@ -6,13 +6,10 @@ import ast.tpd import core.Constants.Constant import core.Contexts._ import core.Denotations.SingleDenotation -import core.Flags.Implicit -import core.Names.TermName import util.Spans.Span import core.Types.{ErrorType, MethodType, PolyType} import reporting._ -import scala.collection.JavaConverters._ object Signatures { diff --git a/compiler/src/dotty/tools/dotc/util/WeakHashSet.scala b/compiler/src/dotty/tools/dotc/util/WeakHashSet.scala index 3dc5761c0244..37931463ec32 100644 --- a/compiler/src/dotty/tools/dotc/util/WeakHashSet.scala +++ b/compiler/src/dotty/tools/dotc/util/WeakHashSet.scala @@ -5,7 +5,6 @@ package dotty.tools.dotc.util import java.lang.ref.{ReferenceQueue, WeakReference} import scala.annotation.{ constructorOnly, tailrec } -import scala.collection.mutable /** * A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other diff --git a/compiler/src/dotty/tools/io/Jar.scala b/compiler/src/dotty/tools/io/Jar.scala index 6baaec175b14..99997ef2de67 100644 --- a/compiler/src/dotty/tools/io/Jar.scala +++ b/compiler/src/dotty/tools/io/Jar.scala @@ -12,7 +12,6 @@ import java.util.jar._ import scala.jdk.CollectionConverters._ import scala.collection.mutable import Attributes.Name -import scala.language.postfixOps import scala.annotation.tailrec // Attributes.Name instances: diff --git a/compiler/src/dotty/tools/repl/CollectTopLevelImports.scala b/compiler/src/dotty/tools/repl/CollectTopLevelImports.scala index f46b5feed76a..f78729d81533 100644 --- a/compiler/src/dotty/tools/repl/CollectTopLevelImports.scala +++ b/compiler/src/dotty/tools/repl/CollectTopLevelImports.scala @@ -1,6 +1,5 @@ package dotty.tools.repl -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Phases.Phase diff --git a/compiler/src/dotty/tools/repl/Rendering.scala b/compiler/src/dotty/tools/repl/Rendering.scala index bb5496f0cc8b..53198678dd80 100644 --- a/compiler/src/dotty/tools/repl/Rendering.scala +++ b/compiler/src/dotty/tools/repl/Rendering.scala @@ -1,21 +1,17 @@ package dotty.tools package repl -import java.io.{ StringWriter, PrintWriter } import java.lang.{ ClassLoader, ExceptionInInitializerError } import java.lang.reflect.InvocationTargetException -import dotc.ast.tpd import dotc.core.Contexts._ import dotc.core.Denotations.Denotation import dotc.core.Flags import dotc.core.Flags._ import dotc.core.Symbols.{Symbol, defn} import dotc.core.StdNames.{nme, str} -import dotc.core.NameOps._ import dotc.printing.ReplPrinter -import dotc.reporting.{MessageRendering, Message, Diagnostic} -import dotc.util.SourcePosition +import dotc.reporting.Diagnostic /** This rendering object uses `ClassLoader`s to accomplish crossing the 4th * wall (i.e. fetching back values from the compiled class files put into a diff --git a/compiler/src/dotty/tools/repl/ReplCompiler.scala b/compiler/src/dotty/tools/repl/ReplCompiler.scala index 9249172b5d4d..ed097ac1277a 100644 --- a/compiler/src/dotty/tools/repl/ReplCompiler.scala +++ b/compiler/src/dotty/tools/repl/ReplCompiler.scala @@ -3,7 +3,6 @@ package dotty.tools.repl import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.ast.{tpd, untpd} import dotty.tools.dotc.ast.tpd.TreeOps -import dotty.tools.dotc.core.Comments.CommentsContext import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Decorators._ import dotty.tools.dotc.core.Flags._ @@ -12,8 +11,8 @@ import dotty.tools.dotc.core.Phases.Phase import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.core.Symbols._ import dotty.tools.dotc.reporting.Diagnostic -import dotty.tools.dotc.transform.{PostTyper, Staging} -import dotty.tools.dotc.typer.ImportInfo._ +import dotty.tools.dotc.transform.PostTyper +import dotty.tools.dotc.typer.ImportInfo.{withRootImports, RootRef} import dotty.tools.dotc.typer.TyperPhase import dotty.tools.dotc.util.Spans._ import dotty.tools.dotc.util.{ParsedComment, SourceFile} diff --git a/compiler/src/dotty/tools/repl/ReplDriver.scala b/compiler/src/dotty/tools/repl/ReplDriver.scala index f69a7ca142fb..72983ff18260 100644 --- a/compiler/src/dotty/tools/repl/ReplDriver.scala +++ b/compiler/src/dotty/tools/repl/ReplDriver.scala @@ -22,8 +22,8 @@ import dotty.tools.dotc.core.Symbols.{Symbol, defn} import dotty.tools.dotc.interfaces import dotty.tools.dotc.interactive.Completion import dotty.tools.dotc.printing.SyntaxHighlighting -import dotty.tools.dotc.reporting.{ConsoleReporter, MessageRendering, StoreReporter} -import dotty.tools.dotc.reporting.{Message, Diagnostic} +import dotty.tools.dotc.reporting.{ConsoleReporter, StoreReporter} +import dotty.tools.dotc.reporting.Diagnostic import dotty.tools.dotc.util.Spans.Span import dotty.tools.dotc.util.{SourceFile, SourcePosition} import dotty.tools.dotc.{CompilationUnit, Driver} diff --git a/compiler/src/dotty/tools/repl/ScriptEngine.scala b/compiler/src/dotty/tools/repl/ScriptEngine.scala index 501dbd0263d7..27369a94b516 100644 --- a/compiler/src/dotty/tools/repl/ScriptEngine.scala +++ b/compiler/src/dotty/tools/repl/ScriptEngine.scala @@ -3,7 +3,7 @@ package repl import java.io.{Reader, StringWriter} import javax.script.{AbstractScriptEngine, Bindings, ScriptContext, ScriptEngine => JScriptEngine, ScriptEngineFactory, ScriptException, SimpleBindings} -import dotc.core.StdNames.{nme, str} +import dotc.core.StdNames.str /** A JSR 223 (Scripting API) compatible wrapper around the REPL for improved * interoperability with software that supports it. diff --git a/compiler/src/dotty/tools/runner/ScalaClassLoader.scala b/compiler/src/dotty/tools/runner/ScalaClassLoader.scala index af9e54f3506d..c7d58de05dfd 100644 --- a/compiler/src/dotty/tools/runner/ScalaClassLoader.scala +++ b/compiler/src/dotty/tools/runner/ScalaClassLoader.scala @@ -1,7 +1,6 @@ package dotty.tools package runner -import scala.language.implicitConversions import java.lang.ClassLoader import java.lang.invoke.{MethodHandles, MethodType} diff --git a/compiler/src/dotty/tools/scripting/ScriptingDriver.scala b/compiler/src/dotty/tools/scripting/ScriptingDriver.scala index bce54183807b..9abe5f81c4cd 100755 --- a/compiler/src/dotty/tools/scripting/ScriptingDriver.scala +++ b/compiler/src/dotty/tools/scripting/ScriptingDriver.scala @@ -2,7 +2,6 @@ package dotty.tools.scripting import java.nio.file.{ Files, Paths, Path } import java.io.File -import java.net.{ URLClassLoader } import dotty.tools.dotc.Driver import dotty.tools.dotc.core.Contexts, Contexts.{ Context, ctx } diff --git a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala index 6d9ff6ca68a8..76bf3ec48728 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala @@ -1,10 +1,7 @@ package scala.quoted package runtime.impl -import scala.annotation.internal.sharable -import scala.annotation.{Annotation, compileTimeOnly} -import dotty.tools.dotc import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Flags.* diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 000f84199c27..e97aa061c3f5 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -11,10 +11,9 @@ import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.NameKinds import dotty.tools.dotc.core.StdNames._ import dotty.tools.dotc.quoted.reflect._ -import dotty.tools.dotc.quoted.QuoteUtils._ import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.quoted.{MacroExpansion, PickledQuotes, QuoteUtils} +import dotty.tools.dotc.quoted.{MacroExpansion, PickledQuotes} import scala.quoted.runtime.{QuoteUnpickler, QuoteMatching} import scala.quoted.runtime.impl.printers._ diff --git a/compiler/test/dotty/tools/CheckTypesTests.scala b/compiler/test/dotty/tools/CheckTypesTests.scala index 7a59bc3e5f20..df4bc1636d82 100644 --- a/compiler/test/dotty/tools/CheckTypesTests.scala +++ b/compiler/test/dotty/tools/CheckTypesTests.scala @@ -3,9 +3,7 @@ package dotty.tools import org.junit.Test import org.junit.Assert.{ assertFalse, assertTrue, fail } -import dotc.ast.Trees._ -import dotc.core.Decorators._ -import dotc.core.Contexts.{Context, ctx} +import dotc.core.Contexts.Context class CheckTypeTest extends DottyTest { @Test diff --git a/compiler/test/dotty/tools/DottyTest.scala b/compiler/test/dotty/tools/DottyTest.scala index 43e387623d13..b138b446d67f 100644 --- a/compiler/test/dotty/tools/DottyTest.scala +++ b/compiler/test/dotty/tools/DottyTest.scala @@ -7,10 +7,7 @@ import dotc.core._ import dotc.core.Comments.{ContextDoc, ContextDocstrings} import dotc.core.Contexts._ import dotc.core.Symbols._ -import dotc.core.Flags._ import Types._, Symbols._, Decorators._ -import dotc.printing.Texts._ -import dotc.reporting.ConsoleReporter import dotc.core.Decorators._ import dotc.ast.tpd import dotc.Compiler @@ -25,7 +22,6 @@ trait DottyTest extends ContextEscapeDetection { protected def initialCtx: FreshContext = { val base = new ContextBase {} - import base.settings._ val ctx = base.initialCtx.fresh initializeCtx(ctx) // when classpath is changed in ctx, we need to re-initialize to get the diff --git a/compiler/test/dotty/tools/DottyTypeStealer.scala b/compiler/test/dotty/tools/DottyTypeStealer.scala index 52bf7a7e221a..6477396679c2 100644 --- a/compiler/test/dotty/tools/DottyTypeStealer.scala +++ b/compiler/test/dotty/tools/DottyTypeStealer.scala @@ -1,7 +1,6 @@ package dotty.tools import dotc.ast.tpd -import dotc.core.Names._ import dotc.ast.tpd._ import dotc.core.Contexts.{Context, atPhase} import dotty.tools.dotc.core.Phases.{typerPhase, erasurePhase} diff --git a/compiler/test/dotty/tools/dotc/ast/AttachmentsTest.scala b/compiler/test/dotty/tools/dotc/ast/AttachmentsTest.scala index eda68829daaf..6a69de281bb3 100644 --- a/compiler/test/dotty/tools/dotc/ast/AttachmentsTest.scala +++ b/compiler/test/dotty/tools/dotc/ast/AttachmentsTest.scala @@ -3,7 +3,6 @@ package dotty.tools.dotc.ast import dotty.tools.DottyTest import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.util.Property -import dotty.tools.dotc.transform.PostTyper import org.junit.Test import org.junit.Assert.{assertEquals, assertTrue, fail} diff --git a/compiler/test/dotty/tools/dotc/ast/DesugarTests.scala b/compiler/test/dotty/tools/dotc/ast/DesugarTests.scala index 0242e730913d..dc736596ed9b 100644 --- a/compiler/test/dotty/tools/dotc/ast/DesugarTests.scala +++ b/compiler/test/dotty/tools/dotc/ast/DesugarTests.scala @@ -6,7 +6,6 @@ import core._ import Names._, Types._ , Symbols._, StdNames._, Flags._, Contexts._ import org.junit.Test -import org.junit.Assert._ class DesugarTests extends DottyTest { import tpd._ diff --git a/compiler/test/dotty/tools/dotc/ast/TreeInfoTest.scala b/compiler/test/dotty/tools/dotc/ast/TreeInfoTest.scala index b8e011c8c8dd..0c67eeead86a 100644 --- a/compiler/test/dotty/tools/dotc/ast/TreeInfoTest.scala +++ b/compiler/test/dotty/tools/dotc/ast/TreeInfoTest.scala @@ -5,10 +5,9 @@ package ast import org.junit.Test import core.Names._ import core.StdNames.nme -import core.Types._ import core.Symbols._ import org.junit.Assert._ -import core.Contexts.{Context, ctx} +import core.Contexts.Context class TreeInfoTest extends DottyTest { diff --git a/compiler/test/dotty/tools/dotc/config/CommandLineParserTest.scala b/compiler/test/dotty/tools/dotc/config/CommandLineParserTest.scala index a6bd651c6365..431fb37b8a07 100644 --- a/compiler/test/dotty/tools/dotc/config/CommandLineParserTest.scala +++ b/compiler/test/dotty/tools/dotc/config/CommandLineParserTest.scala @@ -5,7 +5,7 @@ import org.junit.Assert.{assertEquals, assertTrue} import org.junit.Test class CommandLineParserTest: - import CommandLineParser.{tokenize, ParseException} + import CommandLineParser.tokenize private def check(tokens: String*)(input: String): Unit = assertEquals(tokens, tokenize(input)) diff --git a/compiler/test/dotty/tools/dotc/core/SealedDescendantsTest.scala b/compiler/test/dotty/tools/dotc/core/SealedDescendantsTest.scala index 7d90d0ed8870..0ae9069c03d1 100644 --- a/compiler/test/dotty/tools/dotc/core/SealedDescendantsTest.scala +++ b/compiler/test/dotty/tools/dotc/core/SealedDescendantsTest.scala @@ -1,6 +1,6 @@ package dotty.tools.dotc.core -import dotty.tools.dotc.core.Contexts.{Context, ctx} +import dotty.tools.dotc.core.Contexts.Context import dotty.tools.dotc.core.Symbols.* import org.junit.Assert._ diff --git a/compiler/test/dotty/tools/dotc/interactive/CustomCompletionTests.scala b/compiler/test/dotty/tools/dotc/interactive/CustomCompletionTests.scala index ccf211136d51..7e247b51dff6 100644 --- a/compiler/test/dotty/tools/dotc/interactive/CustomCompletionTests.scala +++ b/compiler/test/dotty/tools/dotc/interactive/CustomCompletionTests.scala @@ -9,7 +9,6 @@ import dotc.reporting.StoreReporter import dotc.util.{SourceFile, SourcePosition} import dotc.util.Spans.Span -import org.junit.Assert._ import org.junit.Test class CustomCompletionTests extends DottyTest: diff --git a/compiler/test/dotty/tools/dotc/parsing/DeSugarTest.scala b/compiler/test/dotty/tools/dotc/parsing/DeSugarTest.scala index 51327e99dd01..a54880326704 100644 --- a/compiler/test/dotty/tools/dotc/parsing/DeSugarTest.scala +++ b/compiler/test/dotty/tools/dotc/parsing/DeSugarTest.scala @@ -3,16 +3,12 @@ package dotc package parsing import Tokens._, Parsers._ -import dotty.tools.io._ -import util._ import core._ import ast.Trees._ import ast.desugar -import ast.desugar._ import core.Mode import Contexts.Context -import scala.collection.mutable.ListBuffer class DeSugarTest extends ParserTest { diff --git a/compiler/test/dotty/tools/dotc/parsing/DocstringTests.scala b/compiler/test/dotty/tools/dotc/parsing/DocstringTests.scala index fcd02954d9e0..448b3bfbb489 100644 --- a/compiler/test/dotty/tools/dotc/parsing/DocstringTests.scala +++ b/compiler/test/dotty/tools/dotc/parsing/DocstringTests.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package parsing -import dotty.tools.dotc.core.Contexts.Context import dotty.tools.dotc.ast.Trees._ import org.junit.Assert._ diff --git a/compiler/test/dotty/tools/dotc/parsing/ParserTest.scala b/compiler/test/dotty/tools/dotc/parsing/ParserTest.scala index b247ba1a525d..92327068410e 100644 --- a/compiler/test/dotty/tools/dotc/parsing/ParserTest.scala +++ b/compiler/test/dotty/tools/dotc/parsing/ParserTest.scala @@ -4,11 +4,9 @@ package parsing import dotty.tools.io._ import util._ -import core._ import scala.io.Codec import Tokens._, Parsers._ import ast.untpd._ -import org.junit.Test import scala.collection.mutable.ListBuffer class ParserTest extends DottyTest { diff --git a/compiler/test/dotty/tools/dotc/parsing/desugarPackage.scala b/compiler/test/dotty/tools/dotc/parsing/desugarPackage.scala index 8016a74d4052..7a728f89b61c 100644 --- a/compiler/test/dotty/tools/dotc/parsing/desugarPackage.scala +++ b/compiler/test/dotty/tools/dotc/parsing/desugarPackage.scala @@ -3,7 +3,6 @@ package dotc package parsing import core._, ast._ -import Trees._ object desugarPackage extends DeSugarTest { diff --git a/compiler/test/dotty/tools/dotc/parsing/showTree.scala b/compiler/test/dotty/tools/dotc/parsing/showTree.scala index 18b2203d51ed..d574bb3a0208 100644 --- a/compiler/test/dotty/tools/dotc/parsing/showTree.scala +++ b/compiler/test/dotty/tools/dotc/parsing/showTree.scala @@ -2,16 +2,11 @@ package dotty.tools package dotc package parsing -import ast.Trees._ -import ast.desugar -import ast.desugar._ -import core.Mode object showTree extends DeSugarTest { import dotty.tools.dotc.ast.untpd._ - import Mode._ def test(arg: String) = { val tree: Tree = parse(arg) diff --git a/compiler/test/dotty/tools/dotc/printing/PrinterTests.scala b/compiler/test/dotty/tools/dotc/printing/PrinterTests.scala index 8ce53e28b93d..e6b17fade86f 100644 --- a/compiler/test/dotty/tools/dotc/printing/PrinterTests.scala +++ b/compiler/test/dotty/tools/dotc/printing/PrinterTests.scala @@ -4,8 +4,7 @@ import dotty.tools.DottyTest import dotty.tools.dotc.ast.{Trees,tpd} import dotty.tools.dotc.core.Names._ import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.core.Contexts.{Context, ctx} +import dotty.tools.dotc.core.Contexts.Context import org.junit.Assert.assertEquals import org.junit.Test diff --git a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala index 76f06802c79c..fff29edfa670 100644 --- a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala +++ b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala @@ -3,7 +3,6 @@ package dotc package reporting import core.Contexts.Context -import scala.collection.mutable import org.junit.Assert._ trait ErrorMessagesTest extends DottyTest { diff --git a/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala b/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala index ea5c1b3af5f5..12efc32ff1c5 100644 --- a/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala +++ b/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package reporting -import org.junit.Assert._ import org.junit.Test import core.Contexts._ diff --git a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala index da9b2498d528..ed25f7f8d6c6 100644 --- a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala +++ b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala @@ -11,13 +11,11 @@ import scala.collection.mutable import util.SourcePosition import core.Contexts._ -import Reporter._ import Diagnostic._ -import interfaces.Diagnostic.{ ERROR, WARNING, INFO } +import interfaces.Diagnostic.{ ERROR, WARNING } class TestReporter protected (outWriter: PrintWriter, filePrintln: String => Unit, logLevel: Int) extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with MessageRendering { - import Diagnostic._ protected final val _errorBuf = mutable.ArrayBuffer.empty[Diagnostic] final def errors: Iterator[Diagnostic] = _errorBuf.iterator diff --git a/compiler/test/dotty/tools/dotc/transform/CreateCompanionObjectsTest.scala b/compiler/test/dotty/tools/dotc/transform/CreateCompanionObjectsTest.scala index fa811ccbb9c7..f80094a0bb4c 100644 --- a/compiler/test/dotty/tools/dotc/transform/CreateCompanionObjectsTest.scala +++ b/compiler/test/dotty/tools/dotc/transform/CreateCompanionObjectsTest.scala @@ -2,17 +2,8 @@ package dotty.tools package dotc package transform -import org.junit.{Assert, Test} import core._ -import ast.{tpd, Trees} -import Contexts._ -import Flags._ -import Denotations._ -import NameOps._ -import Symbols._ -import Types._ -import Decorators._ -import Trees._ +import ast.Trees class CreateCompanionObjectsTest extends DottyTest { diff --git a/compiler/test/dotty/tools/dotc/transform/LazyValsTest.scala b/compiler/test/dotty/tools/dotc/transform/LazyValsTest.scala index 96298c571749..b8f96a3c5090 100644 --- a/compiler/test/dotty/tools/dotc/transform/LazyValsTest.scala +++ b/compiler/test/dotty/tools/dotc/transform/LazyValsTest.scala @@ -2,8 +2,6 @@ package dotty.tools package dotc package transform -import org.junit.Test -import org.junit.Assert class LazyValsTest extends DottyTest { /* FIXME: re-enable after adapting to new scheme diff --git a/compiler/test/dotty/tools/dotc/transform/PostTyperTransformerTest.scala b/compiler/test/dotty/tools/dotc/transform/PostTyperTransformerTest.scala index 1e6687617083..d75332b94c1b 100644 --- a/compiler/test/dotty/tools/dotc/transform/PostTyperTransformerTest.scala +++ b/compiler/test/dotty/tools/dotc/transform/PostTyperTransformerTest.scala @@ -2,17 +2,8 @@ package dotty.tools package dotc package transform -import org.junit.{Assert, Test} import core._ import ast.Trees -import Contexts._ -import Flags._ -import Denotations._ -import NameOps._ -import Symbols._ -import Types._ -import Decorators._ -import Trees._ class PostTyperTransformerTest extends DottyTest { /* FIXME: re-enable after adapting to new scheme diff --git a/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala b/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala index 5d159622f5ea..b74e6c0012dc 100644 --- a/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala +++ b/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala @@ -2,17 +2,13 @@ package dotty.tools package dotc package transform -import org.junit.Assert._ import org.junit.Test import dotty.tools.backend.jvm.DottyBytecodeTest class SpecializeFunctionsTests extends DottyBytecodeTest { - import dotty.tools.backend.jvm.ASMConverters._ - import dotty.tools.backend.jvm.AsmNode._ import scala.collection.JavaConverters._ - import scala.tools.asm.tree.MethodNode @Test def specializeParentIntToInt = { val source = """ diff --git a/compiler/test/dotty/tools/dotc/typer/DivergenceChecker.scala b/compiler/test/dotty/tools/dotc/typer/DivergenceChecker.scala index 228d24dd1df0..520b3d2de57e 100644 --- a/compiler/test/dotty/tools/dotc/typer/DivergenceChecker.scala +++ b/compiler/test/dotty/tools/dotc/typer/DivergenceChecker.scala @@ -1,14 +1,10 @@ package dotty.tools.dotc.typer import dotty.tools.DottyTest -import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.core.Contexts._ -import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.core.Types._ import org.junit.Test -import org.junit.Assert.{ assertFalse, assertTrue, fail } +import org.junit.Assert.{ assertTrue, fail } class DivergenceCheckerTests extends DottyTest { @Test diff --git a/compiler/test/dotty/tools/repl/ScriptedTests.scala b/compiler/test/dotty/tools/repl/ScriptedTests.scala index 70f2a44ceea8..5c3a32cd40f8 100644 --- a/compiler/test/dotty/tools/repl/ScriptedTests.scala +++ b/compiler/test/dotty/tools/repl/ScriptedTests.scala @@ -6,7 +6,6 @@ import org.junit.Test /** Runs all tests contained in `compiler/test-resources/repl/` */ class ScriptedTests extends ReplTest { - import ScriptedTests._ @Test def replTests = scripts("/repl").foreach(testFile) diff --git a/compiler/test/dotty/tools/repl/ShadowingBatchTests.scala b/compiler/test/dotty/tools/repl/ShadowingBatchTests.scala index bcfe1c3251a7..e891f0eff696 100644 --- a/compiler/test/dotty/tools/repl/ShadowingBatchTests.scala +++ b/compiler/test/dotty/tools/repl/ShadowingBatchTests.scala @@ -4,12 +4,11 @@ package repl import java.io.File import java.nio.file.Files -import org.junit.{ After, AfterClass, BeforeClass, Ignore, Test } +import org.junit.{ After, AfterClass, BeforeClass, Test } import org.junit.Assert._ import io.{ Directory, PlainDirectory } import dotc.core.Contexts._ import dotc.reporting.{ ErrorMessagesTest, StoreReporter } -import vulpix.TestConfiguration object ShadowingBatchTests: val dir = Directory(Files.createTempDirectory("batch-shadow"))